gpt4 book ai didi

java - CoreConnectionPNames.SO_TIMEOUT 和 CoreConnectionPNames.CONNECTION_TIMEOUT 有什么区别?

转载 作者:行者123 更新时间:2023-11-29 09:07:10 32 4
gpt4 key购买 nike

谁能解释一下这两个参数的区别?

  1. > org.apache.http.params.CoreConnectionPNames.CONNECTION_TIMEOUT ;
  2. > org.apache.http.params.CoreConnectionPNames.SO_TIMEOUT .

根据 javadocs:

CoreConnectionPNames.CONNECTION_TIMEOUT:

Determines the timeout in milliseconds until a connection is established. A timeout value of zero is interpreted as an infinite timeout.

CoreConnectionPNames.SO_TIMEOUT:

Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).

那么,对于第一个,CoreConnectionPNames.CONNECTION_TIMEOUT,它是否发生在发送任何数据之前?对于第二个,CoreConnectionPNames.SO_TIMEOUT,是否意味着已经发送了一些数据?表示已成功建立连接。

谢谢。

最佳答案

does it happen before any data is sent?

是的,确实如此。

does it mean that some data was already sent?

在 HTTP 级别上,不,它没有。 (TCP/IP 或 SSL 可能是另一回事)

Meaning that connection was successfully established.

是的,确实如此。

关于java - CoreConnectionPNames.SO_TIMEOUT 和 CoreConnectionPNames.CONNECTION_TIMEOUT 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14316255/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com