ConnectionTimeout versus SocketTimeout

前端 未结 2 873
陌清茗
陌清茗 2020-11-27 09:31

I\'m having a problem with a library that I am using. It might be the library or it might be me using it wrong!

Basically, when I do this (Timeout in milliseconds)

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 10:01

    A connection timeout is the maximum amount of time that the program is willing to wait to setup a connection to another process. You aren't getting or posting any application data at this point, just establishing the connection, itself.

    A socket timeout is the timeout when waiting for individual packets. It's a common misconception that a socket timeout is the timeout to receive the full response. So if you have a socket timeout of 1 second, and a response comprised of 3 IP packets, where each response packet takes 0.9 seconds to arrive, for a total response time of 2.7 seconds, then there will be no timeout.

提交回复
热议问题