MLton.Socket.shutdown{Read,Write}

Stephen Weeks MLton@sourcelight.com
Tue, 7 Aug 2001 21:59:59 -0700


> Note, the idea of shutdown doing a flush makes sense.
> Re surprises, all kinds: I might later dup it (expecting it to be at EOF for
> reading) and now dup will fail.  I might have extracted the file descriptor,
> and now do an open and get the same file descriptor back.
> It isn't very likely, but there just isn't any gain.  Again, the fact that
> it differs from Unix semantics, which are what people learn, is the real
> argument against it.  If you told me that Unix should do a close on a shutdown,
> I wouldn't argue against it (I wouldn't argue for it, but it would be fine).
> Here it is just going to cause possible problems with no real gain.  Are you
> worried that people are going to run out of file descriptors because the
> did shutdown on a bazillion sockets and forgot to close it?

No, I was mostly worried about the flush.  I am happy with just flushing and not
closing.  But if you feel that would confuse people as well, then I am happy to
leave everything alone.