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

Constructor Index

 o ChatServerThread(Socket, int, Broadcaster)
create thread and initialize client, ID, and broadcaster

Method Index

 o run()
execute the thread - read messages from the client and broadcast them to to all the threads.

Constructors

 o 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

Methods

 o 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