haskell-distributed / network-transport-tcp

TCP Realisation of Network.Transport
http://haskell-distributed.github.com
BSD 3-Clause "New" or "Revised" License
30 stars 27 forks source link

prematureExit if EndPoint is closed or failed #60

Closed avieth closed 7 years ago

avieth commented 7 years ago

It's possible that handleIncomingMessages is run when the remote endpoint has already failed or been closed. These cases are in fact premature exits, and in the case of a failure, ConnectionLost must be enqueued. An example case: connect and send bottom. The value may be evaluated before handleIncomingMessages (run in a separate thread) begins to receive on the socket, and so the event may be skipped, and the testSendException case from network-transport-tests will timeout.

avieth commented 7 years ago

Also included a fix for testReconnect

facundominguez commented 7 years ago

The patch looks good to me. The test may admit some improvement.