A connection timeout occurs only upon starting the TCP connection. This usually happens if the remote machine does not answer. This means that the server has been shut down, you used the wrong IP/DNS name or the network connection to the server is down.
链接超时只发生在TCP链接开始的时候。如果远程机器没有响应,通常发生链接超时。这意味着服务器关机了,你用了错误的IP/DNS名,或者通向这台server的网络断了。
A socket timeout is dedicated to monitor the continuous incoming data flow. If the data flow is interrupted for the specified timeout the connection is regarded as stalled/broken. Of course this only works with connections where data is received all the time.
套接字超时专用于监控持续传来的数据流。如果数据流因为特定的超时中断,链接就被视为中断了。当然,这只针对那些一直在接收数据的链接。
http://stackoverflow.com/questions/7360520/connectiontimeout-versus-sockettimeout