Connection error and connection closed on Socket connection in Cocos2dx Project

Facing some issues while creating socket connection in Cocos2dx iOS platform.

While connecting with local IP address and port number in cocos2dx project it is calling function name(onConnectionError) and function name(onConnectionClosed)

Code
IP:POPT is working web while check in web browser.
_sioClient = SocketIO::connect(“IP:PORT”, *this);

Please suggest me to where is the problem happening whether it is in my IP n Port or with a code I have the problem or else need to enable any permission.

If anybody has experienced and interested in this topic,
any tips, suggestions or recommendation would be appreciated.

Thanks,
Jagdish

take a look in cpp-tests for an example

Did you added below code into info.plist

<key>NSAppTransportSecurity</key>
<dict>
     <key>NSAllowsArbitraryLoads</key>
     <true/>
</dict>

Try to look into error in xcode log.

1 Like

good point! I had forgotten about this step.

@smitpatel88
Thanks you for replied,
I was having some issue with IP:Port version problem.
Not it is working fine I can able to make socket connection Games.

@slackmoehrle
Yeah got it now
Thank you for the suggestion.