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

Re: Patch for using libwww to accept incoming connect

From: Mikhail Grouchinski <mgrouch@usa.net>
Date: 15 Dec 1998 22:40:18 -0000
Message-ID: <19981215224018.25701.qmail@findmail.com>
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

Thank you.

In fact, in my case, I always have only one non-HTTP connection and I need not to listen. The file descriptor for this connection comes from outside (via environment).

I've looked at mget.c

I have more questions to you.
How can I send HTTP request(s), install callback for replies and within this callback
get a pointer to the buffer with the reply body.
Also within the same callback I have to reply 
via my custom socket to the rest of the my system.

How can I implement this with LibWWW?
In mget.c there are no callbacks on replies.

As far as I understand LoadToChunk only sends request and all reading happens in EventLoop.
When does the chunk get filled?
How can I detect that?

Thank you again

See the original message at http://www.egroups.com/list/www-lib/?start=683
Received on Tuesday, 15 December 1998 17:40:28 UTC

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