On 2009 Feb 26, at 16:45, Johan Tibell wrote:
definition of `recv` would look like. My current thinking is that it
would mimic what C/Python/Java does and return a zero length
ByteString when EOF is reached.

Ew.  Isn't this what Maybe is for?

Anyway, the reason recv doesn't return 0 is that if you have a datagram socket, a zero-length recv is valid and doesn't mean EOF. (Not that many UDP-using programs know what to do with a 0-length packet.) So you need to indicate "EOF" (sender closed its end) in some different way. It *should* have been Maybe....

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university    KF8NH


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to