It apparently works under ghc 7.8.3 and windows 10. anyway I did not noticed it. 
I  usually  insert withSocketsDo too.

2015-09-17 14:09 GMT+02:00 Brandon Allbery <allbery.b@gmail.com>:
On Thu, Sep 17, 2015 at 5:50 AM, Alberto G. Corona <agocorona@gmail.com> wrote:
That happens in Windows and Linux, in a single process (like in the example) or within two processes in the same machine.

I'm a little surprised this program works at all on Windows, because the winsock stuff gets torn down when `withSocketsDo $ listenOn port` is done? And you do other socket ops outside of withSocketsDo.

Otherwise, it looks like you check for n < 1, not n < l; you would only detect buffer-full if the entire write failed, not for partial writes.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net



--
Alberto.