client.framework.network
Class ClientSocketCommunicator.SenderThread

java.lang.Object
  extended by client.framework.network.ClientSocketCommunicator.SenderThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ClientSocketCommunicator

protected class ClientSocketCommunicator.SenderThread
extends java.lang.Object
implements java.lang.Runnable

Thread responsible for sending messages to the server. Dependent of whether UDP or TCP is used for the communication, the appropriate transmission mechanisms are used.


Method Summary
 void run()
          Sends messages that are waiting to be sent.
 void sendMessage(java.lang.Object message)
          Called when a new message is to be sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public void run()
Sends messages that are waiting to be sent. When the send queue is empty, this thread sleeps until new messages to be sent arrive.

Specified by:
run in interface java.lang.Runnable

sendMessage

public void sendMessage(java.lang.Object message)
Called when a new message is to be sent. Adds the message to the message queue, and notifies the sender thread that messages are waiting to be sent.

Parameters:
message - The message to be sent.