gpt4 book ai didi

Java TCP 选项

转载 作者:可可西里 更新时间:2023-11-01 02:41:48 25 4
gpt4 key购买 nike

C/Linux有以下...

TCP_KEEPCNT (since Linux 2.4) The maximum number of keepalive probes TCP should send before dropping the con- nection. This option should not be used in code intended to be portable.

   TCP_KEEPIDLE (since Linux 2.4)
The time (in seconds) the connection needs to remain idle

before TCP starts send- ing keepalive probes, if the socket option SO_KEEPALIVE has been set on this socket. This option should not be used in code intended to be portable.

   TCP_KEEPINTVL (since Linux 2.4)
The time (in seconds) between individual keepalive probes.

This option should not be used in code intended to be portable.

我知道这些存在可移植性问题,但无论如何都可以在 Java 中在 Socket 上更改这些吗?

最佳答案

看起来不像您可以从 Java 轻松更改的东西,围绕 C api 的 JNA/JNI 包装器可能是您最安全的选择。

关于Java TCP 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5507071/

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