nw_socket_get_input_frames [C4:1] recvmsg(fd 35, 9216 bytes) [61: Connection refused]

397 views Asked by At

We're using the Apple's Network.framework and send data between an iOS app and a macOS app using UDP. We use bonjour for discovery. It works great. Until it doesn't...

The problem is that when I stop using the iOS app for like 2-3 minutes (No, I don't quit the app nor do I put it in background. I just don't interact with the UI for this short period of time. Otherwise the iOS app is open and active), the connection stops working. By this I mean I press a button that should send some data to the macOS app but it just stops working and on the macOS Xcode console I see this

The debug log of the macOS app says: 2020-12-01 22:40:40.274638+0100 Our app [10750:497151] [] nwsocketgetinputframes [C4:1] recvmsg(fd 35, 9216 bytes) [61: Connection refused]

What is this and how to heal it? Does the 2-3 min pause as symptom / trigger of the above error message ring some bells?

Maybe the most interesting thing is that when I turn off the wifi on the iOS app the app immediately discovers that the macOS app is gone. And when I turn the wifi back on the iOS app immediately discovers and connects with the macOS app. And yet this doesn't heal the problem. The only thing that does it rebuilding the macOS app in Xcode.

0

There are 0 answers