6 F 3 B 0 3 6 2

b.TCP socket interface (See figures 6.3 and 6.4.)

In TCP communication, a pipe-like virtual communications line (connection) is established between sockets on two ports that are communicating (sending and receiving), and since the protocol handles control of reception verification and retransmission processing, it provides a highly reliable communication.

There are two methods for establishing a connection: passive open and active open. In passive open, the local socket is put into a state in which it is waiting for a request to establish a connection from another port. In active open, a request is issued for the establishment of a connection with a socket in the passive open state.

When establishing a connection between two ports, one port must first open a socket in passive open mode, and the other port must perform an active open on a local socket with respect to a remote socket that is in the passive open state.

Since the passive open socket port "provides" data transmission and other services, it is called the "server."

Since the active open socket port "requests" services, it is called the "client."

A socket for which a connection has been established is unable to transfer data with any other sockets unless that connection is first released.

Since sockets are connected by connections, there is no need to specify the transmission source or transmission destination with every data item transmitted.

Transmission source port

Transmission destination port

TCP socket

TCP socket

 

Connection

Client side

Transmission data

Server side

Active open

Passive open

 

Reception verification

Figure 6.3 TCP Socket (Connection)

70

Page 71
Image 71
Toshiba T2N instruction manual TCP socket interface See figures 6.3, TCP Socket Connection