How can I know if a node that is being accessed using TCP socket is alive or if the connection was interrupted and other errors?
Thanks!
You can't.  Any intermediate nodes can drop your packets or the reply packets from the remote node.
Python socket programming