Class ChatServerThread
Class ChatServerThread
java.lang.Object
|
+----java.lang.Thread
|
+----ChatServerThread
- class ChatServerThread
- extends Thread
Chat server thread - thread that handles connection of the Chat Server,
reads messages from the client and broadcast them to all other clients.
- Author:
- Tomer Klainer mandor@cs.huji.ac.il
- See Also:
- ChatServer, ChatClient, Broadcaster
-
ChatServerThread(Socket, int, Broadcaster)
- create thread and initialize client, ID, and broadcaster
-
run()
- execute the thread - read messages from the client and broadcast them to
to all the threads.
ChatServerThread
public ChatServerThread(Socket s,
int num,
Broadcaster bc)
- create thread and initialize client, ID, and broadcaster
- Parameters:
- s - socket to the client
- num - thread id
- bc - shared broadcaster
- See Also:
- Broadcaster
run
public void run()
- execute the thread - read messages from the client and broadcast them to
to all the threads.
- Overrides:
- run in class Thread
- See Also:
- ChatClient, Broadcaster