6 F 3 B 0 3 6 2

8.TCP close request (using the SEND instruction)

a.Function

Close the open TCP socket.

Release the (unlimited wait state) receive request and terminate the TCP socket.

b.Transfer parameters

A A+1 A+2

3100H

CMD = 0039H

SportNO

Module designation Command number Socket identifier (1 to 8)

c.Status (See figure 4.3 for details on bits C, D, E and F.)

B B+1

F E D C B A 9 8 7 6 5 4 3 2 1 0

 

 

 

 

SportNO

TermSTS

Detailed information (Only valid when TermSTS = 0BH.)

SportNO: Socket identifier (1 to 8)

TermSTS: See tables 4.3 and 4.4.

Detail information: See table 4.5.

d.Important items

TCP close requests are processed with the highest priority and other executing requests are discarded, even if the object socket is executing a TCP open, send, or receive request. Other requests during the execution of this request will be discarded.

An error is returned if a close request is issued for a socket that is not yet opened.

Status: Transmission error (TermSTS = 0BH)

Detailed information: Unopened (0081H)

An error is returned if a value other than 1 to 8 is specified as the socket identifier. Status: Transmission error (TermSTS = 0BH)

Detailed information: Illegal socket identifier (0082H)

A TCP receive requests will result in an error being returned if an unlimited wait state TCP open request/receive request is terminated with this request.

Status: Transmission completion timeout (TermSTS = 06H)

Supplement:

The T2N sees its requests (module control and socket interface transmission) to the Ethernet Port as being "transmission" requests. As a result, when a request is forcibly terminated and a response is not received from the Ethernet Port, the result is a send request timeout even if the instruction was a RECV instruction.

If a close request is comes from the remote port TCP socket while a connection is established, the local port must also close the socket. As a technique for checking for the reception of close requests from the remote TCP socket, user programs should monitor the RCLOSE and CONN bits in the socket status. (See section 6.3.)

109

Page 110
Image 110
Toshiba T2N instruction manual 3 B 0 3 6 TCP close request using the Send instruction, Function