I've been using cocoaasyncsocket as a client to a Windows .net server using asyncsocket. I am encoding messages using ProtocolBuffers. Together, these make a great set of tools.
However recently I have noticed that if I leave the client connected to the server for a long time - many hours - when I try to make a request for data, the message appears to get sent but never arrives at the server. I'm calling this a "silent" disconnection because I'm not receiving the usual disconnection that I would if there were a network problem.
I am handling the following methods in my effort to debug, but none of them get called:
- (NSTimeInterval)onSocket:(AsyncSocket *)sock
shouldTimeoutReadWithTag:(long)tag
elapsed:(NSTimeInterval)elapsed
bytesDone:(CFIndex)length {
- (void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err
- (void)onSocketDidDisconnect:(AsyncSocket *)sock
Without any notification, I'm finding this tricky to debug. The server similarly does not show any disconnections.
Would anyone be able to point me in a direction to how to further analyze this?
Many thanks.