|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--SSF.OS.ProtocolSession
|
+--SSF.OS.TCP.tcpSession
This class represents a TCP session of one end of the connection which is identified by source and destination IP address and port number. It keeps all the state information and controls data transfer by using class Send_WndManager and Rcv_WndManager.
| Field Summary | |
static long |
close_timer_basis
CLOSE Timer basis, default value 0.5 seconds. |
static int |
CLOSE_WAIT
|
static int |
CLOSED
|
static int |
CLOSING
|
boolean |
DEBUG
Option used to switch on/off verbose session debugging output. |
static int |
ESTABLISHED
|
static int |
FIN_WAIT_1
|
static int |
FIN_WAIT_2
|
boolean |
INFO
Option used to switch on/off verbose session information output. |
IpHeader |
ipHdr
IP header template of this session. |
ProtocolSession |
ipsess
Local IP Session in the ProtocolGraph. |
static int |
LAST_ACK
|
static int |
LISTEN
|
static long |
maxIdleTime
maximum FIN_WAIT_2 idle time |
static int |
MSL
maximum segment lifetime in slow ticks |
tcpSocket |
mySocket
For listening server TCP session, it is the reference to master server socket. |
Send_WndManager |
snd
Object managing the send queue and processing the received ACKs |
static int |
SYN_RECEIVED
|
static int |
SYN_SENT
|
int |
tcp_state
TCP connection state variable. |
TCP_Header |
tcpHdr
TCP header template of this session. |
tcpSessionMaster |
tcpServ
TCP master service that owns this TCP session. |
static int |
TIME_WAIT
|
| Fields inherited from class SSF.OS.ProtocolSession |
name, use |
| Constructor Summary | |
tcpSession()
False zero-argument constructor to flag improper direct use of the tcpSession protocol from configuration files. |
|
tcpSession(tcpSessionMaster serv)
Initialize TCP session with LISTEN state and port number of the listening server application |
|
tcpSession(tcpSessionMaster serv,
tcpSocket upSession,
ProtocolSession lowSession,
int SrcIpAddr,
int SrcPort,
int DesIpAddr,
int DesPort)
Initialize TCP session with SYN_RECEIVED state and IP address and port number of source and destination |
|
| Method Summary | |
void |
ActiveOpen()
Active open a connection by sending a message with a SYN flag. |
boolean |
close()
Socket closes its TCP session. |
boolean |
closed()
Tell the caller if the TCP connection exist |
void |
CloseStateTransfer1()
State transfer when FIN is received. |
void |
CloseStateTransfer2()
State transfer when 1) FIN is sent; 2) ACK of FIN is received; |
void |
CloseStateTransfer3()
|
void |
fastTimeout()
fast timer function called every 200 ms |
int |
get_protocol_status()
Get the value of protocol_status. |
float |
getSimTime()
|
boolean |
isClosed()
test if the connection is closed |
boolean |
opened()
Tell the caller if the TCP connection exists |
void |
PassiveOpen()
Passive open a listening connection. |
boolean |
push(ProtocolMessage message,
ProtocolSession fromSession)
Classify and process the incoming TCP message according to message flags and connection state. |
void |
read(java.lang.Object[] obj,
int nbytes,
Continuation caller)
|
void |
set_protocol_status(int v)
Set the value of protocol_status. |
void |
slowTimeout()
slow timer function called every 500 ms |
java.lang.String |
stateToString(int state)
|
void |
TwoMSLtimeout()
Performs 2MSL timer and FIN_WAIT_2 timer timeout functions. |
void |
write(dataMessage dmsg,
Continuation caller)
|
| Methods inherited from class SSF.OS.ProtocolSession |
close, closed, config, debugIdentifier, inGraph, init, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean DEBUG
public boolean INFO
public tcpSessionMaster tcpServ
public static final long close_timer_basis
public IpHeader ipHdr
public TCP_Header tcpHdr
public ProtocolSession ipsess
public tcpSocket mySocket
public int tcp_state
public Send_WndManager snd
public static final int CLOSED
public static final int LISTEN
public static final int SYN_SENT
public static final int SYN_RECEIVED
public static final int ESTABLISHED
public static final int CLOSE_WAIT
public static final int CLOSING
public static final int FIN_WAIT_1
public static final int FIN_WAIT_2
public static final int LAST_ACK
public static final int TIME_WAIT
public static int MSL
public static long maxIdleTime
| Constructor Detail |
public tcpSession()
throws TCPException
public tcpSession(tcpSessionMaster serv)
public tcpSession(tcpSessionMaster serv,
tcpSocket upSession,
ProtocolSession lowSession,
int SrcIpAddr,
int SrcPort,
int DesIpAddr,
int DesPort)
| Method Detail |
public java.lang.String stateToString(int state)
public void ActiveOpen()
public void PassiveOpen()
public void CloseStateTransfer1()
public void CloseStateTransfer2()
public void CloseStateTransfer3()
public void slowTimeout()
public void fastTimeout()
public void TwoMSLtimeout()
public boolean opened()
public boolean closed()
public int get_protocol_status()
public void set_protocol_status(int v)
v - Value to assign to protocol_status.
public boolean close()
throws TCPException
TCPExceptionpublic float getSimTime()
public boolean push(ProtocolMessage message,
ProtocolSession fromSession)
throws ProtocolException
push in class ProtocolSessionmessage - incoming TCP messagefromSession - ProtocolSession that invoked the push() method,
here IP.
ProtocolExceptionpublic boolean isClosed()
public void write(dataMessage dmsg,
Continuation caller)
public void read(java.lang.Object[] obj,
int nbytes,
Continuation caller)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||