I encounter this error(UDP didNotSendDataWithTag: 213 Error: Error Domain=NSPOSIXErrorDomain Code=32 "Broken pipe" UserInfo=0x165acab0 {NSLocalizedDescription=Broken pipe}) after the app comes back after screen lock.
Note: Before screen lock, a udp send loop is running which sends udp data every 10 secs.
I tried reopening the socket again but that didn't work. It seems that the socket was not really closed at all. Its just that the data cant be sent. Does anyone know the solution to this problem? Many thanks!
I was able to solve the problem by closing the udp socket when the app is went to background
and then turning it back on when it comes back to foreground.
Hope this helps other developers when they encounter this problem. :)