Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
To determine when a peer is offline or idle, a program will implement a [@https://en.wikipedia.org/wiki/Timeout_(computing) timeout] algorithm, which closes the connection after a specified amount of time if some condition is met. For example, if no data is received for the duration. A timeout may be used to:为了判断对端是否已离线或处于空闲状态,程序需要实现超时算法。该算法会在满足特定条件(例如,在一段时间内未收到任何数据)时关闭连接。超时机制可用于以下场景: