views:

73

answers:

1

My iPhone application is using AsyncUdpSocket to handle a UDP socket.But when my application goes background in iOs 4.0 and return back, i am getting following error.

Application 'MyAppName' exited abnormally with signal 13: Broken pipe

This is because my sockets are disconnected when my application goes to background.

How to run UDP sockets in background ? Please help me..Thanks in advance..

A: 

This is not related to UDP. EPIPE only happens for "stream" file descriptors - Unix pipes and TCP sockets.

I'm guessing you have some sort of a control TCP connection which times out on the remote end when you go into background. You need to figure out how to keep it alive or re-connect when the app wakes up.

You can also handle (or ignore) EPIPE, see sigaction(2), and react to it accordingly on return from write(2).

Nikolai N Fetissov