i have a class called test::Client that extends TCPSession. when i telnet to server, it spawns a Client & everything works fine. however, when i use ^] quit to end the telnet connection, i can't figure out how to detect the broken connection. i tried Socket::isConnected(), testing eof, &c, for *tcp(). using 1.9.7. suggestions appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i have a class called test::Client that extends TCPSession. when i telnet to server, it spawns a Client & everything works fine. however, when i use ^] quit to end the telnet connection, i can't figure out how to detect the broken connection. i tried Socket::isConnected(), testing eof, &c, for *tcp(). using 1.9.7. suggestions appreciated.
it took some time, & it's probably not great use of common C++ lib, but here's a solution i worked out: http://www.stcath.org/dev/socket.cpp.html#_solution