seda.sandStorm.lib.aSocket.nio
Class SockState

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

public class SockState
extends SockState

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


Field Summary
private  java.nio.ByteBuffer byte_buffer
           
private static boolean DEBUG
           
private  java.nio.ByteBuffer read_byte_buffer
           
private  NIOSelectSource read_selsource
           
private  java.nio.channels.SelectionKey rselkey
           
private  NIOSelectSource write_selsource
           
private  java.nio.channels.SelectionKey wselkey
           
 
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

rselkey

private java.nio.channels.SelectionKey rselkey

wselkey

private java.nio.channels.SelectionKey wselkey

byte_buffer

private java.nio.ByteBuffer byte_buffer

read_byte_buffer

private java.nio.ByteBuffer read_byte_buffer

read_selsource

private NIOSelectSource read_selsource

write_selsource

private NIOSelectSource write_selsource
Constructor Detail

SockState

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