We are testing apps for IPV6 compatibility in both IPV6 (nat64 network) only and IPV4 only networks. We had been using the GCDAsyncSocket network library to make socket connections for our app to send and receive data over it.
1. When we test our iOS app (using the old GCDAsyncSocket code that we had downloaded in 2014) connecting to IPV6 only (nat-64) network as per Apple's guides here, the socket connection gets established successfully as soon as we log into the app, but within a few seconds (probably 20-30seconds , sometimes in a couple of mins), the -(void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err
gets called disconnecting the socket.
This happens only once every time we log out and log in to our app. As soon as we login, socket gets established, then suddenly gets disconnected throwing the below error:
2016-12-17 09:11:10.650437 atCommand Enterprise[288:13780] LOG: Socket disconnect
2016-12-17 09:11:11.979232 atCommand Enterprise[288:13780] LOG: -
[MLAPIControl socketDidDisconnect:withError:] -> 175
Printing description of err:
Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
UserInfo={_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}
Printing description of ((__NSCFDictionary *)0x0000000170470880):
{
"_kCFStreamErrorCodeKey" = 57;
"_kCFStreamErrorDomainKey" = 1;
}
Printing description of sock:
<GCDAsyncSocket: 0x101737d70>
2016-12-17 09:11:55.853540 atCommand Enterprise[288:13780] LOG: Error
Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo=
{_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}
2016-12-17 09:11:55.858775 atCommand Enterprise[288:13780] LOG: -
[MLAPIControl socketDidDisconnect:withError:] :
2. The exactly same issue of socket disconnection, after initial successful connection, happens even when i downloaded the latest (Latest commit 8ce941d 25 days ago) GCDAsyncSocket library code.
Any help is greatly appreciated. Thank You.