I have a mission-critical real-time data application that uses a TCP connection between the client and server. In some cases, the connection periodically dies (SocketException). No problem - just reconnect and move on. However, the customers aren't thrilled with these intermittent drops in connectivity.
I'd like to know where to point the finger. Is it the client or server? Hardware or software? Is it something about the ethernet link? The end result would be to show the user an indicator of connection health, so that a bad link can be investigated and remedied.
Are there any metrics I can pull from the TcpClient, Socket, or anything else that will tell me about the health of the connection? Perhaps average time to ack, number of retries, etc?
I specifically want to know about a TCP connection - not just the ethernet connection as a whole (your LAN connection might be dandy, but there could be an issue going to an outside server).
Of course I could ping the remote host, but I don't think that would really give me the kind of stats I'm looking for. For one thing, I could be pinging a router if the server is hiding behind NAT.