>The sockets mechanism implemented in STk 2.2 works fine but has some
>missings. The one I am interested to is the capability to make non
>blocking server sockets to avoid the socket-accept-connection to stop
>the STk execution if there are no sockets to satisfy. This is a real
>problem when creating servers with GUI, that can be blocked waiting for
>a connection.
Without addressing the specifics of the code you post (don't you need to
pass #t as the second argument to 'make-server-socket' to set O_NDELAY?),
I have some general comments.
In my view, you really want multithreading here: a 'server thread'
blocks on the socket until a connection is available, and other threads
will compute unhindered in the mean time. I have implemented a
preemptive tasking system for STk (2.1.7 so far, should work (possibly
with minor changes) with 2.2 but I haven't yet tried); the system is
currently being tested by a few people, and I use it with sockets in the
manner I described above. If you are interested in being an *alpha*
tester you can get the file from
ftp://ftp.cs.uoregon.edu/pub/lth/tasking-alpha2.tar.gz
There are instructions included.
(Note to all: this release is _only_ intended for people who are
familiar with threads programming and STk internals. There Will Be
Bugs. I haven't the time to help you learn either of these. That said,
the more testers the better :-)
--lars
Received on Mon Jul 24 1995 - 18:10:36 CEST