|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public static interface SocketInterface.TcpSocketInterface
Defines the interface for TcpSocket specific implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jist.swans.trans.SocketInterface |
|---|
SocketInterface.TcpServerSocketInterface, SocketInterface.TcpSocketInterface |
| Method Summary | |
|---|---|
void |
connect(java.net.SocketAddress endpoint)
Connects this socket to the server. |
void |
connect(java.net.SocketAddress endpoint,
int timeout)
Connects this socket to the server with a specified timeout value. |
void |
constructPackets()
Creates packets to be sent based on the receiver's advertised window (managing flow control). |
byte[] |
getBytesFromSocket(int length)
This method is called by the input stream to retrieve data from the transport layer. |
java.nio.channels.SocketChannel |
getChannel()
Returns the unique SocketChannel object associated with this socket, if any. |
InputStream |
getInputStream()
Returns an input stream for this socket. |
boolean |
getKeepAlive()
Tests if SO_KEEPALIVE is enabled. |
java.net.InetAddress |
getLocalAddress()
Gets the local address to which the socket is bound. |
boolean |
getOOBInline()
Tests if OOBINLINE is enabled. |
OutputStream |
getOutputStream()
Returns an output stream for this socket. |
int |
getPort()
Returns the remote port to which this socket is connected. |
java.net.SocketAddress |
getRemoteSocketAddress()
Returns the address of the endpoint this socket is connected to, or null if it is unconnected. |
int |
getSendBufferSize()
Get value of the SO_SNDBUF option for this Socket, that is the buffer size used by the platform for output on this Socket. |
int |
getSoLinger()
Returns setting for SO_LINGER. |
boolean |
getTcpNoDelay()
Tests if TCP_NODELAY is enabled. |
int |
getTrafficClass()
Gets traffic class or type-of-service in the IP header for packets sent from this Socket. |
boolean |
isConnected()
Returns the connection state of the socket. |
boolean |
isInputShutdown()
Returns wether the read-half of the socket connection is closed. |
boolean |
isOutputShutdown()
Returns wether the write-half of the socket connection is closed. |
void |
persistTimerTimeout(int timerId,
int seqNum)
Execution when persist timer times out (sending probe message). |
int |
queueBytes(byte[] data)
This method is called to send bytes to the other side. |
void |
resetTimerTimeout(int timerId)
Execution when reset timer times out (closing the socket). |
void |
retransmitTimerTimeout(int seqNum,
long time)
Attempt to retransmit because the timer times out. |
void |
sendUrgentData(int data)
Send one byte of urgent data on the socket. |
void |
setKeepAlive(boolean on)
Enable/disable SO_KEEPALIVE. |
void |
setOOBInline(boolean on)
Enable/disable OOBINLINE (receipt of TCP urgent data) By default, this option is disabled and TCP urgent data received on a socket is silently discarded. |
void |
setSendBufferSize(int size)
Sets the SO_SNDBUF option to the specified value for this Socket. |
void |
setSoLinger(boolean on,
int linger)
Enable/disable SO_LINGER with the specified linger time in seconds. |
void |
setTcpNoDelay(boolean on)
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). |
void |
setTrafficClass(int tc)
Sets traffic class or type-of-service octet in the IP header for packets sent from this Socket. |
void |
shutdownInput()
Places the input stream for this socket at "end of stream". |
void |
shutdownOutput()
Disables the output stream for this socket. |
void |
startPersistTimer(int seqNum)
Methods for persist timer (sender sending packets to probe receiver window). |
void |
startResetTimer()
Methods for reset timer (this timer is used when establishing or closing connection --> If no reply is received, connection is reset). |
void |
startRetransmitTimer(int seqNum,
long time)
Schedule a retransmission for a message. |
void |
startTimeWaitTimer()
Methods for timer during TIME_WAIT state. |
void |
timeWaitTimerTimeout()
Execution when time wait timer times out (closing the socket). |
| Methods inherited from interface jist.swans.trans.SocketInterface |
|---|
_jistPostInit, bind, checkPacketandState, close, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, isBound, isClosed, setReceiveBufferSize, setReuseAddress, setSoTimeout, setTcpEntity, toString |
| Method Detail |
|---|
void connect(java.net.SocketAddress endpoint)
throws JistAPI.Continuation
endpoint - the SocketAddress
JistAPI.Continuation - never; blocking event.
void connect(java.net.SocketAddress endpoint,
int timeout)
throws JistAPI.Continuation
endpoint - the SocketAddresstimeout - the timeout value to be used in milliseconds
JistAPI.Continuation - never; blocking event.
java.nio.channels.SocketChannel getChannel()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
InputStream getInputStream()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean getKeepAlive()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
java.net.InetAddress getLocalAddress()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean getOOBInline()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
OutputStream getOutputStream()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
int getPort()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
java.net.SocketAddress getRemoteSocketAddress()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
int getSendBufferSize()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
int getSoLinger()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean getTcpNoDelay()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
int getTrafficClass()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean isConnected()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean isInputShutdown()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.
boolean isOutputShutdown()
throws JistAPI.Continuation
JistAPI.Continuation - never; blocking event.void sendUrgentData(int data)
data - The byte of data to sendvoid setKeepAlive(boolean on)
on - whether or not to have socket keep alive turned onvoid setOOBInline(boolean on)
on - true to enable OOBINLINE, false to disable.void setSendBufferSize(int size)
size - the size to which to set the send buffer size.
This value must be greater than 0.
void setSoLinger(boolean on,
int linger)
on - whether or not to linger on.linger - how long to linger for, if on is true.void setTcpNoDelay(boolean on)
on - true to enable TCP_NODELAY, false to disable.void setTrafficClass(int tc)
tc - an int value for the bitset.
void shutdownInput()
throws JistAPI.Continuation,
java.io.IOException
JistAPI.Continuation - never; blocking event.
java.io.IOException - if an I/O error occurs when shutting down this socket.
void shutdownOutput()
throws JistAPI.Continuation,
java.io.IOException
JistAPI.Continuation - never; blocking event.
java.io.IOException - if an I/O error occurs when shutting down this socket.
int queueBytes(byte[] data)
throws JistAPI.Continuation
data - bytes to be stored in the send buffer
JistAPI.Continuation - never; blocking event.
byte[] getBytesFromSocket(int length)
throws JistAPI.Continuation
length - number of bytes to retrieve
JistAPI.Continuation - never; blocking event.void constructPackets()
void startRetransmitTimer(int seqNum,
long time)
seqNum - sequence number of message to retransmittime - wait time before attempting to retransmit
void retransmitTimerTimeout(int seqNum,
long time)
seqNum - sequence number of message to retransmittime - wait time before attempting to retransmitvoid startPersistTimer(int seqNum)
seqNum - number of the probe message
void persistTimerTimeout(int timerId,
int seqNum)
timerId - ID of the persist timerseqNum - number of the probe messagevoid startResetTimer()
void resetTimerTimeout(int timerId)
timerId - ID of the reset timervoid startTimeWaitTimer()
void timeWaitTimerTimeout()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||