ignoring sigpipe
ignoring sigpipe
- Subject: ignoring sigpipe
- From: Michael Robinette <email@hidden>
- Date: Fri, 4 Apr 2003 12:04:54 -0800
I have an async CFSocket based server.
My code to send data looks like this:
if( _socket && CFSocketIsValid( _socket ) )
{
CFSocketEnableCallBacks( _socket, kCFSocketWriteCallBack );
if( CFSocketSendData( _socket, NULL, theData, 0 ) != 0 )
{
NSLog( @"send failed: x", (unsigned long) self );
[self close];
}
}
This code get's called every time there is a writeable callback.
I also set the app to ignore SIGPIPE and verify that the handler is
SIG_IGN, as demonstrated in the MoreUNIX examples.
But SIGPIPE is still raised when I transfer large amounts of data. It
happens often, but not reliably, and it only happens with a certain
client app.
If SIGPIPE means that the remote socket has closed, and I haven't
gotten a kCFSocketDataCallback with a zero length data, then how do I
avoid this situation?
- michael
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.