As is known, the same exception can be detonated in multiple ways, an example of this IOException that starts when there is a NetworkStream timeout or when the host of a TcpClient is disconnected. What I need is a way to get the error code of each of these scenarios to be able to act in the right way. Greetings