W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2001

How do I get HTHost_listen to listen on a particular port?

From: Worik Macky Turei Stanton <worik@noggon.co.nz>
Date: 18 Mar 2001 10:07:47 +1200
To: www-lib@w3.org
Message-ID: <87lmq4gibw.fsf@noggon.co.nz>

What I want is to open a socket, connect to it (from another
application) and get my hands on all the data written to that socket
from the other application.

To that end I want to start listenoing on a port.

I am using HTHost_listen.  Is that the correct function?

It is not documented (surprise!) in
http://www.w3.org/Library/User/Extrnals.html but I found it in the
source and appears to be the mate to HTHost_accept.

Guessing wildly I implement it so...
host_local = HTHost_new("", 8088);
net_local = HTNet_new(host_local);
host_remote = HTHost_new("", 0);
net_remote = HTNet_new(host_remote);
HTNet_setTransport (net_remote, HTTransport_find (0, "tcp"));
if(HTHost_listen(host_local, net_remote, "") == HT_ERROR){

I get a listening socket, but on a different port.

So can anybody point me in the right direction?  I am starting to
think that I a\should be lookng for a different library!


                     Worik Macky Turei Stanton
    This line would not have seven words if only it had eight words less.
Received on Saturday, 17 March 2001 17:04:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:53 UTC