Does socket.io work in mobile?

Discussion and feedback on Construct 2

Post » Sat Jan 11, 2014 7:53 pm

Hello,

I am trying out the C2 demo version and I have a question. Please forgive me if its been asked before. I would like to make a turn based game for iOS and Android that will communicate with a NodeJS server. Does the standard websocket plugin work correctly when an iOS and Android build is compiled with something like CacoonJS or PhoneGap? I am unable to try this with the demo build and would like to confirm before purchasing.

Thanks!   
B
5
S
1
Posts: 24
Reputation: 423

Post » Sat Jan 11, 2014 8:01 pm

Some do, some don't. It depends on the particular device.
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726

Post » Sat Jan 11, 2014 9:17 pm

CocoonJS does offer support for async WebSockets (and 99% of WS usage is async), but my understanding is that it can be fiddley to get it to work properly. The nice thing about Socket.io is all of the fallbacks that it offers if any one protocol is not supported, all the way down to Comet long-held requests.

If you already own C2, why not try a simple test, like one button to press in the client to send a message to the server, server creates a random string and reports it back to the client where it is displayed?

I would be interested to know the results :)
B
3
Posts: 2
Reputation: 229

Post » Sun Jan 12, 2014 6:06 pm

Thank you for the replies. Unfortunately I do not own C2 and cannot perform any testing. I don't want to purchase C2 and find out it does not have reliable socket communication on iOS and Android. From the research I've been doing online, socket.io is inherently not reliable for mobile and often fails for various reasons.

If anyone using C2 has tested socket.io reliability on iOS or Android devices please share your experience. This is vital to determining whether or not C2 can be used for a networked mobile game.    

Thanks
B
5
S
1
Posts: 24
Reputation: 423

Post » Sun Jan 12, 2014 6:15 pm

C2 has a free version that supports websockets.
https://www.scirra.com/construct2/releases/r152/download

Also:
http://www.websocket.org/
The first demo can connect with C2's object.
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726

Post » Sun Jan 12, 2014 8:57 pm

not sure are you talking about websockets or socket.io.

but for websckets you can check here for some additional info:

http://caniuse.com/websockets

http://en.wikipedia.org/wiki/WebSocket#Browser_support

http://www.websocket.org/echo.html

(protip : open up http://www.websocket.org/echo.html in your browser and you'll see does it support websockets)
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712

Post » Sun Jan 12, 2014 9:06 pm

I think the regular Android browser wont work, but Chrome should.
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726


Return to Construct 2 General

Who is online

Users browsing this forum: bobcgausa and 10 guests