Zach Beane <email@example.com> wrote:
| >firstname.lastname@example.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:
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 Warnock <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607