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

Re: Simultaneous requests in a gateway application

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Mon, 14 Dec 1998 09:34:09 -0500
To: www-lib@w3.org
Message-ID: <367521E1.DC55E580@w3.org>
To: Mikhail Grouchinski <mgrouch@usa.net>

Mikhail Grouchinski wrote:
> 
> Please help...
> I need to issue a non-blocking request from
> event callback.
> This source is a skeleton for a gateway.
> It should read from one socket (via custom protocol) and talk to the rest of the world via HTTP. Any requests don't block and replies are processed as they come. The gateway should keep track what reply coresponds to a particular request.

As I mentioned in my previous mail, you will soon (like today or
tomorrow) be able to listen to sockets and handle incoming requests in
libwww for your special socket. Until then I would suggest that you have
a look at the sample app

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

as this tells you how to start libwww and make multiple, non blocking
requests.

As for how to register a separate open socket in the libwww event loop,
you create an event object as you have done. Then you start reading from
the socket and when you get a would block, you register that event as
pending for read. You will then get called back when the socket is
ready. The context is simply a pointer that will get passed along with
the callback - it is for you to use as you like.
  
Henrik
Received on Monday, 14 December 1998 09:34:14 EST

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