Class Broadcaster
Class Broadcaster
java.lang.Object
|
+----Broadcaster
- class Broadcaster
- extends Object
Shared broadcaster for the Chat Server - this object is shared by all the
threads, it keeps track of all the output lines and broadcast messages
to all clients.
- Author:
- Tomer Klainer mandor@cs.huji.ac.il
- See Also:
- ChatServerThread
-
Broadcaster()
- create broadcaster with empty hash table
-
add(int, PrintStream)
- add client to hash table
-
broadcast(String)
- broadcast message to all clients in table
-
remove(int)
- remove client from hash table
Broadcaster
public Broadcaster()
- create broadcaster with empty hash table
broadcast
public void broadcast(String message)
- broadcast message to all clients in table
- Parameters:
- message - the message
add
public void add(int client_num,
PrintStream ps)
- add client to hash table
- Parameters:
- client_num - id of the thread handling this client
- ps - output stream to that client
remove
public void remove(int client_num)
- remove client from hash table
- Parameters:
- client_num - id of the thread handling this client