0

Currently I am developing a multiplayer game for Android which can be played between 4 players. The online module with Socket.IO and Node.js in fully functional. Now i'm into developing the same via Wifi or Hotspot. With the help of NSD I did managed to discover the ips and ports available services. With the help of ServerSocket connected to another device. As I am a rookie in Java Programming I'm not confident about managing the the connection consistent.

  • Is there any libraries or samples available to look into, like the Socket.IO I used in online connectivity.
  • How can I manage the connection to other 3 devices at the same time in Socket

This game is developing in iOS also, they managed socket connection using GCDAsyncSocket

shine_joseph
  • 2,922
  • 4
  • 22
  • 44
  • If you have it all working for online then you would have it working for wifi too i would think. Why not? What would it differ from a mobile connection? The four devices are connected to your node.js server on the internet i think? – greenapps Aug 24 '16 at 13:51
  • Yes. That's correct.But here one device acts as the server and all the others should connect to it. So I guess socket.io client library can't be used here. And also I connected one client device to one server, but how will I manage if another device connects to the same server? – shine_joseph Aug 24 '16 at 14:00
  • `But here one device acts as the server `. Then you should directly mention that in your post. – greenapps Aug 24 '16 at 14:48
  • It is pretty normal that different clients connect to the same server. You will have that too with your online solution so i dont understand your problem with that. – greenapps Aug 24 '16 at 14:49
  • In online version, server is socket.io using node.js, which is done by another person. All the devices are connected to it as clients. So just one connection need to be managed in one device. But here one device being the server need to send data to all the other devices. How can I manage all the 3 connections managed in one server device. – shine_joseph Aug 25 '16 at 04:26
  • The ServerSocket has all the connections. Running in different threads. You dont need to do anything special for that. And for the rest you can ask that other person. Or here. But please questions to the point. You are not the first who makes a server with clients all is done before. – greenapps Aug 25 '16 at 06:17
  • Sorry about that. I know that many people around the world done this, that's why I asked for help. As I mentioned in the post I'm novice in Java. Thanks for your help. – shine_joseph Aug 25 '16 at 06:45

0 Answers0