Introduction - If you have any usage issues, please Google them yourself
Multiplayer chat, multithreading, multi-threading, implementation
In a multiplayer server, we should have a servo end thread responsible for listening to the client connection, if there is a client of attachment, was assigned to a client thread dedicated to this client connection, and record it on the client side queue, then listen to the next.
A client thread should work, is to read the customer wired the user input information, it is not responsible for response messages, but will read the message in the message queue, in addition to all this in our example, the client thread is also responsible for their own connection state, if the user needs, the client thread will be responsible for their removal from the client queue.
The broadcast executive is responsible for taking out the messages in the queue and then sending a message to the client in the queue that exists in the queue.
Packet : 29782186javachar_.rar filelist
JavaChar◎\BroadCastThread.java
JavaChar◎\ChatClientSocket.java
JavaChar◎\ClientThread.java
JavaChar◎\MultiChatClient.java
JavaChar◎\MultiChatServer.java
JavaChar◎\ServerThread.java
JavaChar◎