// Tests for remote close. // Establish a connection. +.0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 500 +.2 connect(500, ..., ...) = 0 // Send SYN segment. +.0 TCP > S seq 0(0) win 65535 // Receive SYN-ACK segment. +.1 TCP < S. seq 0(0) ack 1 win 65535 // Send ACK on SYN-ACK segment. +.0 TCP > . seq 1(0) ack 1 win 65535 // Succeed to establish connection. +.0 wait(500, ...) = 0 // Receive FIN segment. +.1 TCP < F. seq 1(0) ack 1 win 65535 // Send ACK on FIN segment. +.0 TCP > . seq 1(0) ack 2 win 65534 // Close connection. +.2 close(500) = 0 // Send FIN segment. +.0 TCP > F. seq 1(0) ack 2 win 65534 // Receive ACK on FIN segment. +.1 TCP < . seq 2(0) ack 2 win 65535 // Succeed to close connection immediately. +.0 wait(500, ...) = 0