Okay, so basically I am making a server. That has a structure like this:
- A thread that accepts connections.
- A thread that logs a player in. (It's a game)
- And a thread that connects to a "Friends server". This server holds data of all online players. (used for chatting between different servers (worlds)).
Now my question is; how can I make the thread, that is connected to the friends server, idle. So when a new player logs in, I can directly send a packet to the friends server that holds the player's name and world with just one method ( FriendsServerConnector.getConnector().updatePlayer s(String name) ), without letting the thread stop (which it already did, after the socket passed the connection protocol)
I hope my question is clear.