Multiplayer game dev / UDP sockets

Hello,

I’m fairly new to cocos2d-x and been learning / prototyping with it to evaluate if it can build the game I have imagined. I think the engine itself is solid and can pull it off, I’m just wondering about the network layer. I’ve been planning to write the game in JS, and from my reading it sounds like JS has bindings for everything the C++ version offers. How about for networking though? Perhaps this is something I’d tackle on my own and write my own bindings, but I figure this is a common thing for anyone writing a multiplayer game that there should be an API for UDP sockets? Also, I’m thinking perhaps the C++ version would have more powerful and perhaps should just go that route?

thank you :smile: for any suggestions

Hi, JS bindings have only WebSockets implementation, that mean it is Web (HTTP/HTTPS) oriented, if you need such low level sockets, you can take my source code with TCP/IP Sockets implementation sample (client is C++ and server is Java): here is it
it is MIT licensed, you free of charge to use it

wow, thanks for the nice response with a full example :slight_smile: this is a great starting point.

fill free to contact with me, will be happy to help

@elux
I have also tutorial to get you started :
Java a sync netty server
JS cocos2d-x
using websockets

nice one, i try to use Netty before, but it is to complex, so i rewrite my server with Scala + Akka.IO

Akka.io idea is very good one !
it is using web sockets and a sync and have clusters out of the box