Posted read() hangs on socket disconnect
Posted read() hangs on socket disconnect
- Subject: Posted read() hangs on socket disconnect
- From: Jonathon Kuo <email@hidden>
- Date: Wed, 27 May 2009 16:32:59 -0700
I have two processes communicating over the internet via TCP/IP
sockets, a Linux sender and a Mac receiver. The receiving process uses
a read() posted on a socket that reads small data packets in a loop.
It works fine until the sender quits (disconnects/aborts). I was
expecting the posted read() call to return with a status < 0, but it
never returns, it just hangs forever. Is there some other way (C
function, Mac network framework?) that will cover this exit case so
that I can be notified when the sender drops out?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden