seda.sandStorm.lib.aSocket.nio
Class DatagramSockState

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

public class DatagramSockState
extends DatagramSockState

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


Field Summary
private static boolean DEBUG
           
private  java.nio.channels.DatagramChannel nio_dgsock
           
private  NIOSelectSource nio_read_selsource
           
private  java.nio.ByteBuffer nio_readbuf
           
private  NIOSelectSource nio_write_selsource
           
private  java.nio.channels.SelectionKey rselkey
           
private  java.nio.channels.SelectionKey wselkey
           
 
Fields inherited from class seda.sandStorm.lib.aSocket.DatagramSockState
clogged_numtries, clogged_qel, closed, cur_write_buf, cur_write_req, maxPacketSize, numEmptyWrites, outstanding_writes, pkt, readBuf, readClogTries, readCompQ, seqNum, udpsock, 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
DatagramSockState(AUdpSocket sock, java.net.InetAddress addr, int port)
           
 
Method Summary
protected  boolean addWriteRequest(aSocketRequest req, SourceIF write_selsource)
           
protected  void close(SinkIF closeEventQueue)
           
protected  void connect(java.net.InetAddress addr, int port)
           
protected  void doRead()
           
protected  java.net.DatagramSocket getSocket()
           
(package private)  void initWrite(AUdpWriteRequest req)
           
protected  void readInit(SelectSourceIF read_selsource, SinkIF compQ, int readClogTries)
           
 java.lang.String toString()
           
protected  boolean tryWrite()
           
protected  void writeMaskDisable()
           
protected  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

rselkey

private java.nio.channels.SelectionKey rselkey

wselkey

private java.nio.channels.SelectionKey wselkey

nio_dgsock

private java.nio.channels.DatagramChannel nio_dgsock

nio_read_selsource

private NIOSelectSource nio_read_selsource

nio_write_selsource

private NIOSelectSource nio_write_selsource

nio_readbuf

private java.nio.ByteBuffer nio_readbuf
Constructor Detail

DatagramSockState

public DatagramSockState(AUdpSocket sock,
                         java.net.InetAddress addr,
                         int port)
                  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 DatagramSockState

doRead

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

addWriteRequest

protected boolean addWriteRequest(aSocketRequest req,
                                  SourceIF write_selsource)
Specified by:
addWriteRequest in class DatagramSockState

initWrite

void initWrite(AUdpWriteRequest req)

tryWrite

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

writeReset

void writeReset()

writeMaskEnable

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

writeMaskDisable

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

close

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

toString

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

getSocket

protected java.net.DatagramSocket getSocket()
Specified by:
getSocket in class DatagramSockState

connect

protected void connect(java.net.InetAddress addr,
                       int port)
Specified by:
connect in class DatagramSockState