seda.sandStorm.lib.aSocket.nbio
Class SockState

java.lang.Object
  extended by seda.sandStorm.lib.aSocket.SockState
      extended by seda.sandStorm.lib.aSocket.nbio.SockState
All Implemented Interfaces:
aSocketConst

 class SockState
extends SockState

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


Field Summary
private static boolean DEBUG
           
private  seda.nbio.NonblockingInputStream nbis
           
private  seda.nbio.NonblockingOutputStream nbos
           
private  SelectSource read_selsource
           
private  seda.nbio.SelectItem readsi
           
private  SelectSource write_selsource
           
private  seda.nbio.SelectItem writesi
           
 
Fields inherited from class seda.sandStorm.lib.aSocket.SockState
clogged_numtries, clogged_qel, closed, conn, cur_length_target, cur_offset, cur_write_req, nbsock, numActiveWriteSockets, numEmptyWrites, outstanding_writes, pkt, readBuf, readClogTries, readCompQ, seqNum, writeBuf, writeClogThreshold, 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(ATcpConnection conn, java.net.Socket nbsock, int writeClogThreshold)
           
SockState(ATcpConnection conn, java.net.Socket nbsock, java.lang.Integer writeClogThreshold)
           
 
Method Summary
protected  boolean addWriteRequest(aSocketRequest req, SelectSourceIF write_selsource)
           
protected  void close(SinkIF closeEventQueue)
           
protected  void doRead()
           
protected  void initWrite(ATcpWriteRequest req)
           
protected  void readInit(SelectSourceIF read_selsource, SinkIF compQ, int readClogTries)
           
protected  boolean tryWrite()
           
protected  void writeMaskDisable()
           
protected  void writeMaskEnable()
           
 
Methods inherited from class seda.sandStorm.lib.aSocket.SockState
toString
 
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

nbis

private seda.nbio.NonblockingInputStream nbis

nbos

private seda.nbio.NonblockingOutputStream nbos

readsi

private seda.nbio.SelectItem readsi

writesi

private seda.nbio.SelectItem writesi

read_selsource

private SelectSource read_selsource

write_selsource

private SelectSource write_selsource
Constructor Detail

SockState

public SockState(ATcpConnection conn,
                 java.net.Socket nbsock,
                 int writeClogThreshold)
          throws java.io.IOException
Throws:
java.io.IOException

SockState

public SockState(ATcpConnection conn,
                 java.net.Socket nbsock,
                 java.lang.Integer writeClogThreshold)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

readInit

protected void readInit(SelectSourceIF read_selsource,
                        SinkIF compQ,
                        int readClogTries)
Specified by:
readInit in class SockState

doRead

protected void doRead()
Specified by:
doRead in class SockState

addWriteRequest

protected boolean addWriteRequest(aSocketRequest req,
                                  SelectSourceIF write_selsource)
Specified by:
addWriteRequest in class SockState

initWrite

protected void initWrite(ATcpWriteRequest req)
Specified by:
initWrite in class SockState

tryWrite

protected boolean tryWrite()
                    throws SinkClosedException
Specified by:
tryWrite in class SockState
Throws:
SinkClosedException

writeMaskEnable

protected void writeMaskEnable()
Specified by:
writeMaskEnable in class SockState

writeMaskDisable

protected void writeMaskDisable()
Specified by:
writeMaskDisable in class SockState

close

protected void close(SinkIF closeEventQueue)
Specified by:
close in class SockState