| java.lang.Object seda.sandStorm.lib.aSocket.ATcpClientSocket
ATcpClientSocket | public class ATcpClientSocket (Code) | | An ATcpClientSocket implements an asynchronous outgoing socket connection.
Applications create an ATcpClientSocket and associate a SinkIF with it.
When the connection is established an ATcpConnection object will be pushed
to the given SinkIF. The ATcpConnection is then used for actual
communication.
A Sandstorm stage would use this as follows:
SinkIF mySink = config.getSink(); // 'config' passed to stage init()
ATcpClientSocket sock = new ATcpClientSocket(addr, port, mySink);
author: Matt Welsh See Also: ATcpConnection |
Constructor Summary | |
public | ATcpClientSocket(InetAddress addr, int port, SinkIF compQ) Create a socket connecting to the given address and port.
An ATcpConnection will be posted to the given SinkIF when the
connection is established. | public | ATcpClientSocket(String host, int port, SinkIF compQ) Create a socket connecting to the given host and port.
An ATcpConnection will be posted to the given compQ when the
connection is established. | public | ATcpClientSocket(InetAddress addr, int port, SinkIF compQ, int writeClogThreshold, int connectClogTries) Create a socket connecting to the given address and port with the
given writeClogThreshold value. | public | ATcpClientSocket(String host, int port, SinkIF compQ, int writeClogThreshold, int connectClogTries) Create a socket connecting to the given host and port with the
given writeClogThreshold value.
An ATcpConnection will be posted to the given compQ when the
connection is established. | protected | ATcpClientSocket() |
Method Summary | |
public InetAddress | getAddress() Return the InetAddress which this socket is connected to. | public int | getPort() Return the port which this socket is connected to. |
ATcpClientSocket | public ATcpClientSocket(InetAddress addr, int port, SinkIF compQ)(Code) | | Create a socket connecting to the given address and port.
An ATcpConnection will be posted to the given SinkIF when the
connection is established. If an error occurs, an
ATcpConnectFailedEvent will be posted instead.
|
ATcpClientSocket | public ATcpClientSocket(String host, int port, SinkIF compQ) throws UnknownHostException(Code) | | Create a socket connecting to the given host and port.
An ATcpConnection will be posted to the given compQ when the
connection is established. If an error occurs, an
ATcpConnectFailedEvent will be posted instead.
|
ATcpClientSocket | public ATcpClientSocket(InetAddress addr, int port, SinkIF compQ, int writeClogThreshold, int connectClogTries)(Code) | | Create a socket connecting to the given address and port with the
given writeClogThreshold value.
An ATcpConnection will be posted to the given compQ when the
connection is established. If an error occurs, an
ATcpConnectFailedEvent will be posted instead.
Parameters: writeClogThreshold - The maximum number of outstanding writeson this socket before a SinkCloggedEvent is pushed to theconnection's completion queue. This is effectively the maximum depththreshold for this connection's SinkIF. The default value is -1, whichindicates that no SinkCloggedEvents will be generated. Parameters: connectClogTries - The number of times the aSocket layer willattempt to push a new entry onto the given SinkIF while theSinkIF is full. The queue entry will be dropped after this manytries. The default value is -1, which indicates that the aSocketlayer will attempt to push the queue entry indefinitely. |
ATcpClientSocket | public ATcpClientSocket(String host, int port, SinkIF compQ, int writeClogThreshold, int connectClogTries) throws UnknownHostException(Code) | | Create a socket connecting to the given host and port with the
given writeClogThreshold value.
An ATcpConnection will be posted to the given compQ when the
connection is established. If an error occurs, an
ATcpConnectFailedEvent will be posted instead.
Parameters: writeClogThreshold - The maximum number of outstanding writeson this socket before a SinkCloggedEvent is pushed to theconnection's completion queue. This is effectively the maximum depththreshold for this connection's SinkIF. The default value is -1, whichindicates that no SinkCloggedEvents will be generated. Parameters: connectClogTries - The number of times the aSocket layer willattempt to push a new entry onto the given SinkIF while theSinkIF is full. The queue entry will be dropped after this manytries. The default value is -1, which indicates that the aSocketlayer will attempt to push the queue entry indefinitely. |
ATcpClientSocket | protected ATcpClientSocket()(Code) | | |
getAddress | public InetAddress getAddress()(Code) | | Return the InetAddress which this socket is connected to.
|
getPort | public int getPort()(Code) | | Return the port which this socket is connected to.
|
|
|