G
Guest
Before I go and make massive changes to a TCP/IP library I made, I was
wondering if the detection of connection loss is possible through the
TCPClient class.
The problem I have is that I make a connection to another application using
a TCPClient in one app and a Listener with Client in the other app. I close
the app with the listener. I then try to send data to the listener app.
TCPClient.Connected returns true after the remote connection is forcefully
closed. I understand that the value of TCPClient.Connect is based on the
success of the previous send/recieve action. When I perform a send operation,
there is no exception thrown. Trying to perform a send operation a second
time throws a socket exception stating the connection was closed at the
remote end.
I was hoping that the exception would be thrown on the first send operation
after the connection was closed. Any way around this or will I have to send
test bytes at the start of each send operation in order to test the integrity
of the TCP connection? Any help would be great thanks )
wondering if the detection of connection loss is possible through the
TCPClient class.
The problem I have is that I make a connection to another application using
a TCPClient in one app and a Listener with Client in the other app. I close
the app with the listener. I then try to send data to the listener app.
TCPClient.Connected returns true after the remote connection is forcefully
closed. I understand that the value of TCPClient.Connect is based on the
success of the previous send/recieve action. When I perform a send operation,
there is no exception thrown. Trying to perform a send operation a second
time throws a socket exception stating the connection was closed at the
remote end.
I was hoping that the exception would be thrown on the first send operation
after the connection was closed. Any way around this or will I have to send
test bytes at the start of each send operation in order to test the integrity
of the TCP connection? Any help would be great thanks )