MLton.Socket improvement

Henry Cejtin henry@sourcelight.com
Tue, 18 Dec 2001 04:04:13 -0600


I don't understand your claim, but I think you were confused.  At the moment,
the socket you do accept's on has to be closed by knowing that it is really
a file descriptor and using Posix.IO.close on it.  If it were wrapped up in
closures that you could never close that file descriptor.  I agree that the
one you get as a result of an accept is wrapped into one of the streams so it
will get get closed.  Did I miss something?
In the mean time, I seem to have gotten a way to convert a file descriptor
into a TextIO.outstream in SML/NJ.  The only trick was that you have to provide
both writeVec and writeArr functions, and for the latter there isn't a way
to convert the CharArray into a Word8Array without doing a copy.