Page 1 of 1

Nonblocking Sockets in CLISP

Posted: Wed Sep 24, 2008 8:25 am
by schoppenhauer
I am currently trying to write a small, single-threaded IRC-Server using clisp. I chose clisp, because it is small. Nonblocking Reading seems to be no problem, as socket:socket-status should be able to listen for new IO-Events on multiple Sockets and Servers (I didnt try this very much so far, but it seemed to work in the few things I have already tried with it).
My problem is the output: When a new Message arrives, I will have to broadcast it to all other Listeners. Therefore, I will have to send it, and then do a finish-output - which will presumably block until the whole Data is sent and ACK-ed. If one of the receivers has a slow connection, it will slow down the others, too. But if I do not force the output, and some message was very small, it will maybe not be sent for a long time.
My question is: Is there some possibility to achieve something like "send anything from the buffer as soon as possible, and notify me, as soon as you are ready"? So I can send further output to the other receivers which may have a faster connection, not waiting for the slower connection.
There are some socket options like O_ASYNC, etc., but it seems that these cannot really be used with clisp.

Re: Nonblocking Sockets in CLISP

Posted: Wed Sep 24, 2008 10:51 pm
by ramarren
I don't know much about sockets, especially in CLISP, but looking at http://www.lispworks.com/documentation/ ... finish.htm maybe force-output rather than finish-output would help?

Re: Nonblocking Sockets in CLISP

Posted: Thu Sep 25, 2008 3:43 am
by schoppenhauer
Seems so. Thank you.