<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Lars,<br>
<br>
Thanks very much for that intro. I will go through the source code of
sw-http.<br>
<br>
Chaitanya<br>
<br>
Lars Rune Nøstdal wrote:
<blockquote cite="mid:1230100439.4113.22.camel@blackbox.nostdal.org"
type="cite">
<pre wrap="">On Fri, 2008-12-19 at 03:04 +0530, Chaitanya Gupta wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I can't seem to find the IOLib documentation -- there's no link to it on
the project page at common-lisp.net.
I want to try out the I/O multiplexer but I am clueless on how to go
about working with it. Any help on this (or pointer to the doc location)
would be great.
Cheers,
Chaitanya
</pre>
</blockquote>
<pre wrap=""><!---->
Hi,
I've written a simple HTTP server that uses IOLib. Maybe it can help one
figure out how IOLib works or can be used:
<a class="moz-txt-link-freetext" href="http://common-lisp.net/~lnostdal/programming/lisp/sw-http/">http://common-lisp.net/~lnostdal/programming/lisp/sw-http/</a>
Basically start by creating a server socket (server.lisp):
* make-socket (iolib)
* ..and make it non-blocking
* set-io-handler (iolib)
* set-error-handler (iolib)
set-io-handler (iolib) dispatches to the handle-socket-event (sw-http,
server.lisp) callback which calls connection-start-reading (sw-http,
connection.lisp).
connection-start-reading sets up a new callback, connection-handle
(sw-http, connection.lisp) by calling set-io-handler (iolib) on the
client socket. It also makes sure the client socket is made
non-blocking.
connection-handle has a (case event ..) form which leads to
request-handle (sw-http, request-incoming.lisp) for :read events.
Ok, that's basically it with regards to the multiplexing stuff really.
This should be familiar stuff quite similar to what's going on in C on a
"concept" level. You keep reading until reading would block then make a
note of where you are now then return to the event loop (the blocking
event-dispatch call/loop in server.lisp) so the next waiting event in
line can be served.
_______________________________________________
IOLib-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:IOLib-devel@common-lisp.net">IOLib-devel@common-lisp.net</a>
<a class="moz-txt-link-freetext" href="http://common-lisp.net/cgi-bin/mailman/listinfo/iolib-devel">http://common-lisp.net/cgi-bin/mailman/listinfo/iolib-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>