Connection error and connection closed on Socket connection in Cocos2dx Project

Connection error and connection closed on Socket connection in Cocos2dx Project
0.0 0

#1

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


#2

take a look in cpp-tests for an example


#3

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.


#4

good point! I had forgotten about this step.


#5

@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.


#6

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