W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1998

Patch for using libwww to accept incoming connections

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 15 Dec 1998 00:34:56 -0500
Message-Id: <3.0.5.32.19981215003456.0302c1c0@localhost>
To: www-lib@w3.org

For those of you who want to use libwww for both clients and servers...

Although libwww is primarily for clients, it is in fact symmetric in that
it can handle both client requests and server requests. The way this is
handled is that each protocol is registered with both a client handler and
a server handler - depending on which type of request you use, one of them
is called. Note that in order to be able to serve any document, there
actually have to be a server handler. Currently, libwww only comes with a
raw socket loader which isn't much of a server.

The protocol handler used to serve the request is determined by the URI -
just as for client side requests. That is, libwww can in fact
simultaneously be the server for multiple protocols if you really want to.
Examples of URIs that you can use are noop://localhost:8888 which means
that libwww starts listening on port 8888 (see the listen example for
details). Other examples are http://localhost:7777 which means that it
listens for HTTP on port 7777. Again, there is no HTTP server in libwww -
this is just an example.

I have now resurrected an old socket listen tool which you can find at

	http://www.w3.org/Library/Examples/listen.c

I have committed this to CVS - it doesn't (shouldn't) affect client side
one bit. Here is that complete diff

	http://www.w3.org/Library/User/Patch/listen.patch
	 
As usual, you can get it from CVS as described in

	http://www.w3.org/Library/cvs.html#update

and recompile as described in

	http://www.w3.org/Library/cvs.html#Boot

Henrik
	
--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk
Received on Tuesday, 15 December 1998 00:35:00 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 17:59:24 EDT