amber.client
Class SendThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--amber.client.SendThread
All Implemented Interfaces:
java.lang.Runnable

public class SendThread
extends java.lang.Thread

Thread to deal with the transmission of messages destined for the Server.

See Also:
ApplicationHandler, ComponentHandler, BaseComponent

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SendThread(java.net.Socket socket, SocketConnection parent)
          Construct the thread, with it's parent class so it may pass back messages.
SendThread(java.net.Socket socket, SocketConnection parent, java.util.Vector queue)
          Construct the thread, with it's parent class so it may pass back messages.
 
Method Summary
 void addPacket(Packet packet)
          Adds a packet for transmission to the server.
 java.util.Vector getQueue()
          Returns the transmission queue of outgoing packets.
 void run()
          Primary operating function for the thread.
 void terminate()
          Terminate the thread execution.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SendThread

public SendThread(java.net.Socket socket,
                  SocketConnection parent)
           throws java.io.IOException
Construct the thread, with it's parent class so it may pass back messages.
Parameters:
socket - Socket connected to the remote server.
parent - SocketConnection master for this thread.
Throws:
java.io.IOException - with any errors with the socket.

SendThread

public SendThread(java.net.Socket socket,
                  SocketConnection parent,
                  java.util.Vector queue)
           throws java.io.IOException
Construct the thread, with it's parent class so it may pass back messages.
Parameters:
socket - Socket connected to the remote server.
parent - SocketConnection master for this thread.
queue - Vector of packets to preinitialise the transmission queue with.
Throws:
java.io.IOException - with any errors with the socket.
Method Detail

addPacket

public void addPacket(Packet packet)
Adds a packet for transmission to the server.
Parameters:
packet - Packet to send.

getQueue

public java.util.Vector getQueue()
Returns the transmission queue of outgoing packets.
Returns:
Vector of outgoing packets.

terminate

public void terminate()
Terminate the thread execution.

run

public void run()
Primary operating function for the thread.
Overrides:
run in class java.lang.Thread


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.