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.
鏈接超時(shí)只發(fā)生在TCP鏈接開(kāi)始的時(shí)候婿着。如果遠(yuǎn)程機(jī)器沒(méi)有響應(yīng)严就,通常發(fā)生鏈接超時(shí)柬祠。這意味著服務(wù)器關(guān)機(jī)了倍奢,你用了錯(cuò)誤的IP/DNS名捶闸,或者通向這臺(tái)server的網(wǎng)絡(luò)斷了拷沸。
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.
套接字超時(shí)專(zhuān)用于監(jiān)控持續(xù)傳來(lái)的數(shù)據(jù)流延届。如果數(shù)據(jù)流因?yàn)樘囟ǖ某瑫r(shí)中斷,鏈接就被視為中斷了荔燎。當(dāng)然耻姥,這只針對(duì)那些一直在接收數(shù)據(jù)的鏈接。
http://stackoverflow.com/questions/7360520/connectiontimeout-versus-sockettimeout