I am programming linux device driver over a very slow interface, whose ping round time can be as long as several minutes. When I try to use TCP to establish connection between two nodes the connection always times out.
Is there a method to set the TCP retransmission or handshaking timeout longer in the driver, or are there any commands to set it with? Thanks
Linux has built-in support for keepalive. You need to enable TCP/IP networking in order to use it. You also need procfs support and sysctl support to be able to configure the kernel parameters at runtime.
You can increase or decrease timeouts on TCP sockets using the file tcp_keepalive_time found on the directory /proc/sys/net/ipv4/ . The default timeout value is 7200 (2 hours).
Have you tried searching for an answer to this question? A quick Google search gave me this, which appears to directly address this issue. The summary is that the setting of the net.ipv4.tcp_syn_retries
determines that maximum timeout available to TCP connections.
If that document doesn't answer your question, you should indicate what you tried and how the behavior differed from what you expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With