SO_KEEPALIVE if tcp_keepalive: # 启用KeepAlive选项 sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) # TCP_KEEPCNT:判定断开前的KeepAlive探测次数 ... 网络 2024-09-23 36 点赞 0 评论 54 浏览