How do I know if a TCP connection is terminated? I have an AsynchronousSocketChannel and after I open it, every time I call isOpen() afterwards the result is true.
I am accepting the TCP connection from a web browser.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A TCP connection is up until you get an IOException writing to it or an EOS reading from it. The APIs like isOpen() don’t tell you about the connection state, they tell you about the Socket or Channel state, i.e. what you have done to it yourself.