Nonblocking Sockets in CLISP

Discussion of Common Lisp

Nonblocking Sockets in CLISP

Postby schoppenhauer » Wed Sep 24, 2008 8:25 am

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.
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
schoppenhauer
 
Posts: 99
Joined: Sat Jul 26, 2008 2:30 pm
Location: Germany

Re: Nonblocking Sockets in CLISP

Postby Ramarren » Wed Sep 24, 2008 10:51 pm

I don't know much about sockets, especially in CLISP, but looking at http://www.lispworks.com/documentation/HyperSpec/Body/f_finish.htm maybe force-output rather than finish-output would help?
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: Nonblocking Sockets in CLISP

Postby schoppenhauer » Thu Sep 25, 2008 3:43 am

Seems so. Thank you.
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
schoppenhauer
 
Posts: 99
Joined: Sat Jul 26, 2008 2:30 pm
Location: Germany


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 0 guests