0

Connect to socket through Socket.io api successfully done.

Send message via "socket.emit(event,msg)" succeed.

How to get socket id after connected to socket?

Java (client) code snippet:

IO.Options opts = new IO.Options();
opts.forceNew = true;
opts.reconnection = true;

mSocket = IO.socket(URI.create(CHAT_SERVER_URL),opts);
mSocket.emit("message", "test msg");
mSocket.connect();

How do I:

  • join a room,
  • send msg to room,
  • receive msg from room?

How do I send msg to a specific socket id?

join a room, send msg to room, receive msg from room > everything done with js module, but not in java client.

  • 1
    Formatted code (also starting title with capital letter) – Ole V.V. Dec 08 '16 at 12:20
  • Do you found the static function "URL.create()" in javascript? @ EJP javascript function calling syntax similar to Java, but its not a javascript code, its Java. How could sure its not JAVA its only javascript? see this: https://github.com/socketio/socket.io-client-java and re-edit my question Thanks. – Golam Mawla Newton Dec 11 '16 at 09:46

0 Answers0