• 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
Re: "Broken Pipe" always fatal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Broken Pipe" always fatal?


  • Subject: Re: "Broken Pipe" always fatal?
  • From: Josh Graessley <email@hidden>
  • Date: Fri, 29 Apr 2011 13:39:13 -0700

You can disable the signal for a socket using the SO_NOSIGPIPE socket option as an alternative to handling SIGPIPE. You can then set your process to ignore SIGPIPE.

Once you get an EPIPE error when trying to perform an operation on a socket, that socket is toast. You need to close the socket and attempt to create a new connection. If the new connection fails you can use SCNetworkReachability to be notified when you should attempt the connection again.

-josh

On Apr 29, 2011, at 1:16 PM, Nathan Sims wrote:

> When wifi signals get sufficiently weak, I sometimes receive "Broken Pipe" errors in my TCP/IP-based app, which I trap. I close the connection and reconnect. Is a broken pipe always truly fatal to the connection, or is there a way or socket setting to "ride it out"? I've noticed that it does not seem to ever reconnect by itself. All operations afterwards also receive the broken pipe error until I close() and reconnect...
>
>
> _______________________________________________
> 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

 _______________________________________________
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

  • Follow-Ups:
    • Re: "Broken Pipe" always fatal?
      • From: Nathan Sims <email@hidden>
References: 
 >"Broken Pipe" always fatal? (From: Nathan Sims <email@hidden>)

  • Prev by Date: "Broken Pipe" always fatal?
  • Next by Date: Re: "Broken Pipe" always fatal?
  • Previous by thread: "Broken Pipe" always fatal?
  • Next by thread: Re: "Broken Pipe" always fatal?
  • Index(es):
    • Date
    • Thread