Package edu.pdx.cs410J.net
Class ChatSpeaker
java.lang.Object
edu.pdx.cs410J.net.ChatSpeaker
- All Implemented Interfaces:
Runnable
A
ChatSpeaker runs in the background and sends
ChatMessages over a Socket.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()AChatSpeakeruses wait/notify on itsincominglist to know when to send a message.voidsendMessage(ChatMessage message) Queues a message to be sent.voidSets the socket to which thisChatSpeakersends messages.
-
Constructor Details
-
ChatSpeaker
public ChatSpeaker()Creates a newChatSpeaker
-
-
Method Details
-
setSocket
Sets the socket to which thisChatSpeakersends messages. -
run
AChatSpeakeruses wait/notify on itsincominglist to know when to send a message. For the sake of symmetry, we interrupt it to tell it to stop. -
sendMessage
Queues a message to be sent. This method will be called by a thread other than the one running run().
-