[cs631apue] telnet not detecting socket close

jphillip jphillip at stevens.edu
Sat Nov 10 17:30:07 EST 2012


Hi,  I am able to connect to my server via telnet and send some data.  
After the data is received by the server I print it out and call 
close(int) on the client socket file descriptor from which the data was 
read.  I would expect this to cause telnet to report "Connection closed 
by foreign host" but it does not.  I tried setting the socket option 
SO_LINGER timeout to 0 thinking maybe telnet did something so the server 
thinks the client still had data to transmit but this had no effect.  
Why isn't the socket closing?  Thanks!

Justin



More information about the cs631apue mailing list