seda.sandStorm.lib.aSocket
Class SockState

java.lang.Object
  extended by seda.sandStorm.lib.aSocket.SockState
All Implemented Interfaces:
aSocketConst
Direct Known Subclasses:
SockState, SockState

public abstract class SockState
extends java.lang.Object
implements aSocketConst

Internal class used to represent state of an active socket connection.


Field Summary
protected  int clogged_numtries
           
protected  QueueElementIF clogged_qel
           
protected  boolean closed
           
protected  ATcpConnection conn
           
protected  int cur_length_target
           
protected  int cur_offset
           
protected  ATcpWriteRequest cur_write_req
           
private static boolean DEBUG
           
protected  java.net.Socket nbsock
           
protected static int numActiveWriteSockets
           
protected  int numEmptyWrites
           
protected  int outstanding_writes
           
protected  ATcpInPacket pkt
           
protected  byte[] readBuf
           
protected  int readClogTries
           
protected  SinkIF readCompQ
           
protected  long seqNum
           
protected  byte[] writeBuf
           
protected  int writeClogThreshold
           
protected  ssLinkedList writeReqList
           
 
Fields inherited from interface seda.sandStorm.lib.aSocket.aSocketConst
EVENT_QUEUE_SPIN, EVENT_QUEUE_TIMEOUT, LARGE_AGGREGATION, LISTENSTAGE_NAME, MAX_ACCEPTS_AT_ONCE, MAX_WRITE_LEN, MAX_WRITE_REQS_PER_SOCKET, MAX_WRITES_AT_ONCE, MEASUREMENT_SIZE, READ_BUFFER_COPY, READ_BUFFER_SIZE, READSTAGE_NAME, SELECT_SPIN, SELECT_TIMEOUT, TRYWRITE_SPIN, WRITE_MASK_DISABLE_THRESHOLD, WRITESTAGE_NAME
 
Constructor Summary
SockState()
           
 
Method Summary
protected abstract  boolean addWriteRequest(aSocketRequest req, SelectSourceIF write_selsource)
           
protected abstract  void close(SinkIF closeEventQueue)
           
protected abstract  void doRead()
           
protected abstract  void initWrite(ATcpWriteRequest req)
           
(package private)  boolean isClosed()
           
(package private) static int numActiveWriters()
           
protected abstract  void readInit(SelectSourceIF read_selsource, SinkIF compQ, int readClogTries)
           
 java.lang.String toString()
           
protected abstract  boolean tryWrite()
           
protected abstract  void writeMaskDisable()
           
protected abstract  void writeMaskEnable()
           
(package private)  void writeReset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

nbsock

protected java.net.Socket nbsock

conn

protected ATcpConnection conn

readCompQ

protected SinkIF readCompQ

clogged_qel

protected QueueElementIF clogged_qel

clogged_numtries

protected int clogged_numtries

readClogTries

protected int readClogTries

writeClogThreshold

protected int writeClogThreshold

readBuf

protected byte[] readBuf

closed

protected boolean closed

seqNum

protected long seqNum

outstanding_writes

protected int outstanding_writes

numEmptyWrites

protected int numEmptyWrites

writeReqList

protected ssLinkedList writeReqList

cur_write_req

protected ATcpWriteRequest cur_write_req

cur_offset

protected int cur_offset

cur_length_target

protected int cur_length_target

writeBuf

protected byte[] writeBuf

pkt

protected ATcpInPacket pkt

numActiveWriteSockets

protected static int numActiveWriteSockets
Constructor Detail

SockState

public SockState()
Method Detail

readInit

protected abstract void readInit(SelectSourceIF read_selsource,
                                 SinkIF compQ,
                                 int readClogTries)

doRead

protected abstract void doRead()

addWriteRequest

protected abstract boolean addWriteRequest(aSocketRequest req,
                                           SelectSourceIF write_selsource)

initWrite

protected abstract void initWrite(ATcpWriteRequest req)

tryWrite

protected abstract boolean tryWrite()
                             throws SinkClosedException
Throws:
SinkClosedException

writeReset

void writeReset()

writeMaskEnable

protected abstract void writeMaskEnable()

writeMaskDisable

protected abstract void writeMaskDisable()

numActiveWriters

static int numActiveWriters()

isClosed

boolean isClosed()

close

protected abstract void close(SinkIF closeEventQueue)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object