Socket.io Connection Problem

Hello, I’m new in Multiplayer programming, I’ve created server using node.js and create client in Cocos2dx c++.

When i connect Handshake is succed, but onConnect is not called, then after sometime, connection is closed, here are my logs

>    Connect Start
>     New Socket uriObj = ws://192.168.42.117:3000, caFilePath = 
>     SIOClientImpl::init() successful
>     SIOClientImpl::handshake() called
>     SIOClientImpl::handshake() Uri == ws://192.168.42.117:3000
>     SIOClientImpl::handshake() Pre == http://192.168.42.117:3000/socket.io/?EIO=4&transport=polling
>     SIOClientImpl::handshake() waiting
>     SIOClientImpl::handshake() Request Url - http://192.168.42.117:3000/socket.io/?EIO=4&transport=polling
>     In the constructor of HttpClient!
> D/cocos2d-x debug info: Send HTTP Request -- (null)
>     init socket
> D/cocos2d-x debug info: SIOClientImpl::handshakeResponse() called
>     handshake completed
>     response code: 200
>     response code: 200
>     SIOClientImpl::handshake() succeeded
>     SIOClientImpl::handshake() dump data: 0{"sid":"BiYnqYTlpJoHLFqXAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000}
>     SIOClientImpl::handshake() Socket.IO 1.x detected
>     done parsing 1.x  Values are sid = BiYnqYTlpJoHLFqXAAAC heartbeat = 25 timeout = 20
>     SIOClientImpl::openSocket() called
>     Open Socket s = ws://192.168.42.117:3000/socket.io/websocket/?EIO=4&transport=websocket&sid=BiYnqYTlpJoHLFqXAAAC
> D/cocos2d-x debug info: SIOClientImpl::onOpen socket connected!
> I/art: Ignoring second debugger -- accepting and dropping
> I/art: Ignoring second debugger -- accepting and dropping
> D/cocos2d-x debug info: -->SEND:2
>     Heartbeat sent
> D/cocos2d-x debug info: onClose
>      is closed

Please Help me in this. Its Urgent.

Can you show us your code?

cpp-tests has a working example, IIRC.

Also, perhaps any of these may help: Search results for 'socket.io' - Cocos Forums