[SOLVED] native cocos2d-js connection faild

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

anasmatic
Posts: 30
Joined: 15 Mar 2010, 07:27
Contact:

[SOLVED] native cocos2d-js connection faild

Postby anasmatic » 02 Jun 2015, 10:00

Hi,

I'm developing a multiplayer game with cocos2d-js, I'll port it to web , Android and IOS.

I'm using the JS APIs, and it works great on web.
but when I deploy to native it is not working.
in details :
when I use the HTML5 socket connection port , I got this error:
12:35:55 PM [INFO] SmartFox instance ready!
12:35:55 PM [WebSocket::init] _host: 127.0.0.1, _port: 8787, _path: /websocket
12:35:55 PM JS: Connection failed: Is the server running at all?

and on SFS2x console
11:35:55,095 INFO [New I/O worker #1] sessions.DefaultSessionManager - Session created: { Id: 3, Type: WEBSOCKET, Logged: No, IP: 127.0.0.1 } on Server port: 8787 <---> 4028
11:35:55,138 WARN [New I/O worker #1] netty.WebSocketServerHandler - org.jboss.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Requested subprotocol(s) not supported: default-protocol
11:35:55,148 INFO [New I/O worker #1] sessions.DefaultSessionManager - Session removed: { Id: 3, Type: WEBSOCKET, Logged: No, IP: 127.0.0.1:4028 }


and when I use the default Socket connection Port 9933 I got this error on client:
11:55:19 AM [INFO] SmartFox instance ready!
11:55:19 AM [WebSocket::init] _host: 127.0.0.1, _port: 9933, _path: /websocket
11:55:25 AM JS:Connection failed: Is the server running at all?

and on SFS2x console
10:55:19,806 INFO [SocketReader] sessions.DefaultSessionManager - Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:2656 } on Server port: 9933 <---> 2656
10:55:25,033 INFO [SocketReader] sessions.DefaultSessionManager - Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:2656 }


I see a "protocol not supported" Error when I'm using the HTML5 port,
but when I'm using the socket port 9933, I got no error, just a session created and removed in 5 seconds..
I use custom login and this behavior is similar to when you connect and don't handle the login phase..
and I'm sure that I'm handling the login phase

please advice.
thanks
Last edited by anasmatic on 03 Jun 2015, 07:49, edited 1 time in total.
to pee or not to pee
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: native cocos2d-js connection faild

Postby Lapo » 03 Jun 2015, 06:13

We have addressed this issue in SmartFoxServer 2X 2.10.0

You can upgrade here:
http://www.smartfoxserver.com/download/sfs2x#p=updates

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
anasmatic
Posts: 30
Joined: 15 Mar 2010, 07:27
Contact:

Re: native cocos2d-js connection faild

Postby anasmatic » 03 Jun 2015, 07:48

what a relief,
thank you

now using html5 socket port is possible in my case

thanks again
to pee or not to pee

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 19 guests