Data Sheet
© Copyright 2013 WIZnet Co.,Ltd. All rights reserved.
53
iEthernet
W5200
ESTABLISHMENT: Timeout
The timeout can occur by Connect-request(SYN packet) or its response(SYN/ACK
packet), the DATA packet or its response(DATA/ACK packet), the Disconnect-
request(FIN packet) or its response(FIN/ACK packet) and transmission all TCP packet.
If it cannot transmit the above packets within ‘timeout’ which is configured at RTR
and RCR, the TCP final timeout(TCP
TO
) occurs and the state of Sn_SR is set to
SOCK_CLOSED. Confirming method of the TCP
TO
is as below:
First method :
{
if (Sn_IR(TIMEOUT bit) == ‘1’) Sn_IR(TIMEOUT)=‘1’; goto CLOSED stage;
/* In this case, if the interrupt of Socket n is activated, interrupt occurs. Refer to IR, IMR
Sn_IMR and Sn_IR. */
}
Second method :
{
if (Sn_SR == SOCK_CLOSED) goto CLOSED stage;
}
SOCKET Close
It can be used to close the Socket n , which disconnected by disconnect-process, or
closed by TCP
TO
or closed by host’s need without disconnect-process.
{
/* clear the remained interrupts of Socket n */
Sn_IR = 0xFF;
IR(n) = ‘1’;
/* set CLOSE command */
Sn_CR = CLOSE;
}