I am trying to find a way to create a multiroom Socket. So users can chat in different rooms or privately with other users. Is there a way to do this with the java.net.Socket
and/or java.net.ServerSocket
?
What is the best way to do this? Do I need to open a new port for each room and private chat?
I can see through my IDE that there is a Socket getChannel()
, but unable to find anything about this.
Perhaps I am looking with the wrong words.
I hope someone can help me with this :)