Subject: [clisp-list] Re: [patch] portable araneida

From: Sam Steingold <[email-masked]>
Date: Thu Jun 3 11:03:10 2004

> * Brian Mastenbrook <[email-masked]> [2004-06-03 12:42:31 -0500]:
>
> On Tue, 25 May 2004, Sam Steingold wrote:
>
>> what is "fd-handler"?
>>
>> SOCKET-STATUS appears to be quite sufficient for my server needs.
>> <http://clisp.cons.org/impnotes/socket.html#so-status>
>
> Thanks Sam; SOCKET-STATUS looks like what I was looking for. CMUCL and
> SBCL have an integrated select() loop for the REPL too so that server
> applications don't block the REPL, which is what I was referring to.

I am not sure how to implement this without MT: when a character is
available on STDIN, READ is called, which will then block until the
form is finished.

Note that SOCKET-STATUS works with KEYBOARD-STREAMs (and
TERMINAL-STREAMs too), so you can emulate this yourself.

> when buffering was turned on, araneida never saw the
> requests until after the client closed the connection.

FORCE-OUTPUT is necessary to flush the buffers.

> When it was off, it seemed that the connection was getting closed too
> soon? wget complained about a read error being caused by "connection
> reset by peer". For some reason adding a call to socket:socket-status
> on the client stream before closing fixed this.

maybe SOCKET-SHUTDOWN is what you are looking for?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Let us remember that ours is a nation of lawyers and order.

---

From: Sam Steingold <[email-masked]>
Date: Fri Jun 4 10:01:04 2004

> * Don Cohen <[email-masked]> [2004-06-04 08:51:06 -0700]:
>
> [not to list]
you did CC to <lispweb>!
> Of course you can't just call read if you don't want to block.
> What you can do is collect input into a string and whenever new
> input arrives do read from string to find out whether you have
> enough input.

CLISP uses readline for input.
One has to run it in a separate (C) thread.
Patches are welcome.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Sufficiently advanced stupidity is indistinguishable from malice.