If I understand your question correctly, you need to be able to quickly decide whether the network is slow or completely down.
This is not an easy thing to do.
There are two different situations here. Either your source computer, or some router along the path, are aware of permanent problem with the route to your destination. Or there is no such awareness.
For example, if you pull the LAN cable out of your source computer (the one that sends the request and waits for response), the network driver would be aware that the connection top the world is gone. It would notify you of an error instantaneously. This is the first kind of situation.
On the other hand, if you pull the plug from the destination computer, the destination gateway has no knowledge that that computer went down. Your requests will be sent out on the destination subnet, but they will of course be ignored. This is the second kind of situation.
In the case of remote failure (teh second kind of problem), your TCP stack will eventually decide that the destination machine is not talking. However, it takes minutes. It's a system configuration parameter, I believe.
The only solution that I am aware of is to have asynchronous on-the-wire application level protocol, and some sort of heartbeat message, with reasonable timeout (seconds).