jslibs use a tiny HTTP server to manage network exchange for the XUL debugger.
The source code is:
http://code.google.com/p/jslibs/source/browse/trunk/src/jsdebug/debugger.js#55
There is another (much more complex) HTTP server used by jsircbot:
http://code.google.com/p/jsircbot/source/browse/trunk/httpServer.jsmod
There is no event loop in jslibs, you have to manage I/O events
through the Poll function.
In the following example, socket1.readable() is called if a network
event has been received.
The socket1.readable function is internally called by the Poll function.
Poll may call writable, readable, hangup, exception and error function
for each socket from the descriptor array (1st argument).
socket1.readable = function(soc) { Print( soc.Recv(); ) }
var count = Poll( [socket1, socket2, ...], 1000 );
You can also find many examples with Poll() in the QA tests file:
http://jslibs.googlecode.com/svn/trunk/src/jsio/jsio_qa.js
Franck.
PS. tell me if you need more explanations.
> --
> Group jslibs - http://groups.google.com/group/jslibs -
> jsl...@googlegroups.com
> Unsubscribe: jslibs-un...@googlegroups.com
P
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.430 / Virus Database: 270.14.119/2586 - Release Date: 12/25/09
09:33:00
Franck.