Subject: Re: sbcl networking
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 21 Jan 2006 20:08:20 -0600
Newsgroups: comp.lang.lisp
Message-ID: <LLadnYuHX--JdE_eRVn-qQ@speakeasy.net>
Zach Beane  <xach@xach.com> wrote:
+---------------
| >rpw3@rpw3.org (Rob Warnock) writes:
| > No, the programming language really isn't an issue at all
| > [unless, of course, the language makes it hard to do a
| > "shutdown()" or equivalent]. The situation can arise with
| > *any* TCP-based protocol in which one end wants to "read
| > until EOF" before writing the last data it's going to send
| > before closing the socket.
| 
| djb wrote about this:
|    http://cr.yp.to/tcpip/twofd.html
+---------------

Thanks for the ref! Yes, that's exactly the issue I was trying to explain.

+---------------
| From that page:
|    All of this would have worked perfectly if a TCP connection, just
|    like a UNIX pipe, had been represented as two UNIX file descriptors...
+---------------

And Common Lisp implementors who added networking hooks to their
platforms *could* have also fixed it by, say, giving the routine
that converts an open Unix fd [called MAKE-FD-STREAM in CMUCL;
most CL other implementations have or do something similar] an
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.

But I don't know of one that did.  (Anybody...?)


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607