|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mdw.sandStorm.core.SimpleSink | +--mdw.sandStorm.lib.aSocket.ATcpConnection
An ATcpConnection represents an established connection on an asynchronous socket. It is used to send outgoing packets over the connection, and to initiate packet reads from the connection. When a packet arrives on this connection, an ATcpInPacket object will be pushed to the SinkIF specified by the startReader() call. The ATcpInPacket will contain a pointer to this ATcpConnection. This object also allows the connection to be flushed or closed.
ATcpInPacket
Field Summary | |
(package private) SockState |
sockState
|
java.lang.Object |
userTag
The application may use this field to associate some application-specific state with this connection. |
Constructor Summary | |
protected |
ATcpConnection()
|
(package private) |
ATcpConnection(ATcpClientSocket cliSock,
java.net.InetAddress address,
int port)
|
(package private) |
ATcpConnection(ATcpServerSocket servSock,
java.net.InetAddress address,
int port)
|
Method Summary | |
void |
close(SinkIF compQ)
Close the socket. |
boolean |
enqueue_lossy(QueueElementIF buf)
Enqueue an outgoing packet to be written to this socket. |
void |
enqueue_many(QueueElementIF[] bufarr)
Enqueue a set of outgoing packets to be written to this socket. |
void |
enqueue(QueueElementIF buf)
Enqueue an outgoing packet to be written to this socket. |
void |
flush(SinkIF compQ)
Flush the socket. |
java.net.InetAddress |
getAddress()
Return the address of the peer. |
ATcpClientSocket |
getClientSocket()
Return the ATcpClientSocket from which this connection came. |
int |
getPort()
Return the port of the peer. |
long |
getSequenceNumber()
Returns the next sequence number for packets arriving on this connection. |
ATcpServerSocket |
getServerSocket()
Return the ATcpServerSocket from which this connection came. |
int |
profileSize()
Returns the profile size of this connection. |
int |
size()
Returns the number of elements currently waiting in the sink. |
void |
startReader(SinkIF receiveQ)
Associate a SinkIF with this connection and allow data to start flowing into it. |
void |
startReader(SinkIF receiveQ,
int readClogTries)
Associate a SinkIF with this connection and allow data to start flowing into it. |
java.lang.String |
toString()
|
Methods inherited from class mdw.sandStorm.core.SimpleSink |
enqueue_abort, enqueue_commit, enqueue_prepare, getEnqueuePredicate, setEnqueuePredicate |
Methods inherited from class java.lang.Object |
|
Field Detail |
SockState sockState
public java.lang.Object userTag
Constructor Detail |
ATcpConnection(ATcpClientSocket cliSock, java.net.InetAddress address, int port)
ATcpConnection(ATcpServerSocket servSock, java.net.InetAddress address, int port)
protected ATcpConnection()
Method Detail |
public java.net.InetAddress getAddress()
public int getPort()
public ATcpServerSocket getServerSocket()
public ATcpClientSocket getClientSocket()
public void startReader(SinkIF receiveQ)
public void startReader(SinkIF receiveQ, int readClogTries)
readClogTries
- The number of times the aSocket layer will
attempt to push a new entry onto the given SinkIF while the
SinkIF is full. The queue entry will be dropped after this many
tries. The default value is -1, which indicates that the aSocket
layer will attempt to push the queue entry indefinitely.public void enqueue(QueueElementIF buf) throws SinkException
enqueue
in class SimpleSink
mdw.sandStorm.api.SinkIF
element
- The QueueElementIF
to enqueueSinkFullException
- Indicates that the sink is temporarily full.SinkClosedException
- Indicates that the sink is
no longer being serviced.public boolean enqueue_lossy(QueueElementIF buf)
enqueue_lossy
in class SimpleSink
mdw.sandStorm.api.SinkIF
element
- The QueueElementIF
to enqueuepublic void enqueue_many(QueueElementIF[] bufarr) throws SinkException
enqueue_many
in class SimpleSink
mdw.sandStorm.api.SinkIF
elements
- The element array to enqueueSinkFullException
- Indicates that the sink is temporarily full.SinkClosedException
- Indicates that the sink is
no longer being serviced.public void close(SinkIF compQ) throws SinkClosedException
public void flush(SinkIF compQ) throws SinkClosedException
public int size()
size
in class SimpleSink
public long getSequenceNumber()
public int profileSize()
profileSize
in class SimpleSink
public java.lang.String toString()
toString
in class java.lang.Object
|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |