|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.pdx.cs399J.net.ChatSpeaker
public class ChatSpeaker
A ChatSpeaker runs in the background and sends
ChatMessages over a Socket.
| Constructor Summary | |
|---|---|
ChatSpeaker()
Creates a new ChatSpeaker |
|
| Method Summary | |
|---|---|
void |
run()
A ChatSpeaker uses wait/notify on its
incoming list to know when to send a message. |
void |
sendMessage(ChatMessage message)
Queues a message to be sent. |
void |
setSocket(Socket socket)
Sets the socket to which this ChatSpeaker sends
messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChatSpeaker()
ChatSpeaker
| Method Detail |
|---|
public void setSocket(Socket socket)
ChatSpeaker sends
messages.
public void run()
ChatSpeaker uses wait/notify on its
incoming list to know when to send a message. For
the sake of symmetry, we interrupt it to tell it to stop.
run in interface Runnablepublic void sendMessage(ChatMessage message)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||