Re: getpeername()
Re: getpeername()
- Subject: Re: getpeername()
- From: Cryx <email@hidden>
- Date: Sat, 18 May 2002 01:11:04 -0500
On Tuesday, May 14, 2002, at 06:04 PM, email@hidden wrote:
is there a bug in mac os x's getpeername()?
i have a socket connected to a server... the client is reading
asynchronously in the runloop...
when i kill the server, the read returns with 0 bytes, errno is EAGAIN,
and if i do a getpeername() which was suggested as a way to test to see
if the remote side was gone, it doesn't return -1!!!
anyone else run into this? how do you detect when your server has
disconnected from you?
Unless you put the socket into non-blocking more, a read of length 0 is
the indication that the connection with the remote host has been lost.
I believe the getpeername() test was bad advice.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.