Subject: Re: sbcl networking
From: (Rob Warnock)
Date: Thu, 26 Jan 2006 05:36:38 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Joerg Hoehle  <> wrote:
| (Rob Warnock) writes:
| > option to return a *pair* of uni-directional streams instead of
| > a TWO-WAY-STREAM. ...and of course arranging at the same time
| > that a CLOSE on one of them while the other was still open would
| > automatically perform only the appropriate-direction "shutdown()"
| > and not "close()" the underlying fd until *both* uni-directional
| > streams had been CLOSEd.
| FWIW, CLISP added socket-stream-shutdown after a discussion in
| clisp-lisp from March to May 2002 and clisp-devel from May to July
| 2002.  You may wish to consult the mailing list archives for the
| discussion back then.

Thanks for the references! I'll check them out. 

| No separate Lisp-level streams, though:

Hmmm... That looks like a reasonable API to copy for CMUCL, too,
though I'm not sure the CHANGE-CLASS part would work right on
the structures CMUCL uses for STREAMs. But if the stream doesn't
actually have to change class per se, but only change behavior
w.r.t. OUTPUT-STREAM-P or INPUT-STREAM-P (as appropriate), that
could be make to work quite easily.

| BTW, how would you implement the following behaviour (DWIM
| bidirectional streams): automatically force-output prior to reading?

I wouldn't. [See below.]

| Many people forget FORCE-OUTPUT.  Should we help them transparently or
| see their software fail when run from interactive streams (pty, not
| just socket) instead of pipes?

Their software might also fail to perform as expected [especially if
one includes performance in the expectation] if FORCE-OUTPUTs were
"helpfully" inserted at random. (Think of pipelined protocols...)


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607