net.vattp.tunnel
Class HTTPSocketCtl

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--net.vattp.tunnel.HTTPSocketCtl
All Implemented Interfaces:
Runnable

public class HTTPSocketCtl
extends Thread

Untamed: The class which controls an individual TCP socket.

Author:
Bill Frantz

Field Summary
private  boolean isNeedingSendLimitUpdate
           
private  HTTPClient myClient
           
private  byte myConnectionID
           
private  int myHisSendLimit
           
private  String myHostPort
           
private  InputStream myInputStream
           
private  Object myLock
           
private  int myMySendLimit
           
private  SynchQueue myOutputQueue
           
private  OutputStream myOutputStream
           
private  Socket mySocket
           
private static int SENDLIMIT
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) HTTPSocketCtl(String hostPort, HTTPClient client, byte connectionID)
           
 
Method Summary
(package private)  void close()
           
(package private)  byte[] getHisSendLimit()
          Get the value for the send limit to be sent to the client or null
(package private)  byte[] getIncoming()
           
private  byte[] makeSessionMsg(byte msgID, String reason)
           
 void run()
          Enabled:
(package private)  void sendData(byte[] data)
           
(package private)  void setSendLimit(int limit)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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
 

Field Detail

SENDLIMIT

private static final int SENDLIMIT

myLock

private final Object myLock

myClient

private final HTTPClient myClient

myConnectionID

private final byte myConnectionID

myHostPort

private final String myHostPort

mySocket

private Socket mySocket

myInputStream

private InputStream myInputStream

myOutputStream

private OutputStream myOutputStream

myMySendLimit

private int myMySendLimit

isNeedingSendLimitUpdate

private boolean isNeedingSendLimitUpdate

myHisSendLimit

private int myHisSendLimit

myOutputQueue

private final SynchQueue myOutputQueue
Constructor Detail

HTTPSocketCtl

HTTPSocketCtl(String hostPort,
              HTTPClient client,
              byte connectionID)
Method Detail

close

void close()

getHisSendLimit

byte[] getHisSendLimit()
Get the value for the send limit to be sent to the client or null

Returns:
is a two byte array with the value of the send limit if it should be updated, or null if there is no change.

getIncoming

byte[] getIncoming()

makeSessionMsg

private byte[] makeSessionMsg(byte msgID,
                              String reason)
                       throws IOException
IOException

run

public void run()
Enabled:

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
java.lang.Thread#start(), java.lang.Thread#stop(), java.lang.Thread#Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String), java.lang.Runnable#run()

sendData

void sendData(byte[] data)

setSendLimit

void setSendLimit(int limit)


comments?