gpt4 book ai didi

windows - unix/windows 上的 keepalive 超时

转载 作者:可可西里 更新时间:2023-11-01 02:43:53 26 4
gpt4 key购买 nike

当连接因 keepalive 事件而中断时,aix/linux 上返回的错误是什么?是不是可以区别于其他套接字错误的唯一错误码?

在 Windows 上,这可以是 WSAECONNRESET or WSAENETRESET .

有没有办法在返回 WSAECONNRESET 时区分由于 keepalive 事件导致的错误?

WSAECONNRESET 10054 Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.

最佳答案

Is there a way to differentiate the error due to keepalive activity when WSAECONNRESET is returned ?

没有。在所有情况下,基本条件都是“连接重置”。

关于windows - unix/windows 上的 keepalive 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11856756/

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