Issue 3: Needs a check on closed socket before read
Status:  New
Owner: ----
Reported by philipva...@gmail.com, Apr 23, 2010
Closing a socket at one end would cause recv to go into an infinite loop.

Fix it by not only checking on ret==-1, but also on first read: ret==0 (indicates socket is closed)