W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2001

RE: wwwlib eventloop setup.

From: Fred Covely <fcovely@covely.com>
Date: Fri, 20 Apr 2001 09:57:34 -0700
To: "Lucas Meijer" <mach82@mach8.nl>, <www-lib@w3.org>

Here was what I would do.  Obtain the default windows event loop handler for
server via

	// put my window handler in place of the app default, 'insert in the proc
chain basically
	originalappproc =

	then Intercept all of the events in myAsyncWindowProc, filter out the ones
you want, and
	send the rest back to the originalappproc.

	Something like this should work:

wParam, LPARAM lParam)
		if (!CallWindowProc(libwwwwinproc,hwnd,uMsg,wParam,lParam))
    			return (DefWindowProc(hwnd, uMsg, wParam, lParam));


or something like this.  this may not be entirely correct, but it should
give you
some ideas.  Think hook & filter.

FYI, this is also a great way to integrate your own functions right in
myAsyncWindowProc.  For
example a client thread wants to q a request.  This is a great thing about
libwww, even though
its not multi-threaded, you can handle tons of requests in a single 'server
thread' just
by hook the event loop and intercepting client thread requests.  Thus you
don't have the overhead
of thread switching in the libwww library itself (obviously the client
threads still switch).

Hope that helps.


Fred Covely

-----Original Message-----
From: www-lib-request@w3.org [mailto:www-lib-request@w3.org]On Behalf Of
Lucas Meijer
Sent: Friday, April 20, 2001 8:29 AM
To: www-lib@w3.org
Subject: wwwlib eventloop setup.

Hi All,

  Forgive me if this is not the appropriate list to send this
question to. I've search trough all docs&facs but can't work this out:

I want to use wwwlib in a plugin I'm writing for some serverapplication.

I've studied most of the examples, and they all go into a eventloop sooner
or later.

Since I'm writing this as a plugin, I can only react on 'idle' events I
get from my server sytem, and if I were to go into an eventloop I would
block the server from doing all its regular stuff..

I've been trying to find the way I'm supposed to do this, but have been
unsuccesfull. Can I use www-lib in such a way that I can periodically send
it Update()'s instead of going control to the eventloop and reacint on

Any insights, or pointers to info on this topic would be warmly welcomed.


Received on Friday, 20 April 2001 13:02:52 UTC

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