Re: "Broken Pipe" always fatal?
Re: "Broken Pipe" always fatal?
- Subject: Re: "Broken Pipe" always fatal?
- From: Nathan Sims <email@hidden>
- Date: Fri, 29 Apr 2011 14:55:20 -0700
Interesting. So if I use SO_NOSIGPIPE on the socket and set SIGPIPE to SIG_IGN, what potential change in behavior would result?
On Apr 29, 2011, at 1:39 PM, Josh Graessley wrote:
>
> 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