I have a head-to-head game where two players communicate through a server based on TCP.
I am planning to implement a ping/pong mechanism in order to detect network disconnection situations. For example,
A pings B every 500ms. If A receives no response from B, A shall consider B is disconnected. If A receives no response from the server, A shall consider A is disconnected itself.
Do you think this ping/pong system is needed or other method is recommended?