Does socket.io work in mobile?

0 favourites
  • 7 posts
From the Asset Store
A simple fun and stylish endless scroller game ready to be customized and published.
  • 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!

  • Some do, some don't. It depends on the particular device.

  • 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 :)

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • C2 has a free version that supports websockets.

    scirra.com/construct2/releases/r152/download

    Also:

    websocket.org

    The first demo can connect with C2's object.

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

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

    caniuse.com/websockets

    en.wikipedia.org/wiki/WebSocket

    websocket.org/echo.html

    (protip : open up websocket.org/echo.html in your browser and you'll see does it support websockets)

  • I think the regular Android browser wont work, but Chrome should.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)