Information Technology Reference
In-Depth Information
Originator
Recipient
1. ESTABLISHED
ESTABLISHED
( CLOSE call )
2. FIN-WAIT-1
<SEQ=1000><ACK=99> <CTL=SFIN,ACK>
CLOSE-WAIT
3. FIN-WAIT-2
<SEQ=99><ACK=1001> <CTL=ACK>
CLOSE-WAIT
4. TIME-WAIT
<SEQ=99><ACK=101><CTL=FIN,ACK>
LAST-ACK
5. TIME-WAIT
<SEQ=1001><ACK=102><CTL=ACK>
CLOSED
Figure 24.9 TCP close connection
24.8 TCP user commands
The commands in this section characterise the interface between TCP and the application
program. Their actual implementation depends on the operating system. Section 24.9 dis-
cusses the WinSock implementation.
24.8.1 OPEN
The OPEN call initiates an active or a passive TCP connection. The basic parameters passed
and returned from the call are given next. Parameters in brackets are optional.
Parameters passed:
local port, foreign socket, active/passive [, timeout]
[, precedence] [, security/compartment] [, options])
Parameters returned:
local connection name
These parameters are defined as:
Local port - the local port to be used.
Foreign socket - the definition of the foreign socket.
Active/passive - a passive flag causes TCP to LISTEN, else it will actively seek a con-
nection.
Timeout - if present, this parameter allows the caller to set up a timeout for all data sub-
mitted to TCP. If the data is not transmitted successfully within the timeout period, the
connection is aborted.
Security/compartment - specifies the security of the connection.
Local connection name - a unique connection name is returned which identifies the
socket.
24.8.2 SEND
The SEND call causes the data in the output buffer to be sent to the indicated connection.
Most implementations return immediately from the SEND call, even if the data has not been
sent, although some implementations will not return until either there is a timeout or the data
has been sent. The basic parameters passed and returned from the call are given next. Pa-
rameters in brackets are optional.
Parameters passed:
local connection name, buffer address, byte count, PUSH
flag, URGENT flag [,timeout]
Search WWH ::




Custom Search