• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ignoring sigpipe
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: ignoring sigpipe
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: BSD socket performance problem
  • Next by Date: Re: ignoring sigpipe
  • Previous by thread: Re: BSD socket performance problem [FIXED]
  • Next by thread: Re: ignoring sigpipe
  • Index(es):
    • Date
    • Thread