Hello everyone!
When creating one TCP client socket in my board to connect other TCP server which is unreachable, the time-out interval is very long, so whether can I modify the interval to some little certain value,less than 20 seconds ?
The following is the default value:
Connect Timeout
"> Option name OPT_CONNECT_TIMEOUT
Protocol level SOL_TCP
Values >=180,000 (RTCS maintains the connection for this number of milliseconds).
Default value 480,000 (eight minutes).
Thanks!
From sincerely Jianwu.
Solved! Go to Solution.
Hello Jianwu,
The RTCS setsockopt() API permits the application to set the OPT_CONNECT_TIMEOUT option on a stream socket, which indicates the timeout (in millisec.) when a call to the connect API using that socket will return indicating a connection time-out error.
The RTCS User's Guide appears to indicate the value specified for the OPT_CONNECT_TIMEOUT option is to be >= 180000 msec.
You can change TCP_SENDTIMEOUT_MIN (tcp_prv.h) to your expected value
#define TCP_SENDTIMEOUT_MIN 100000L /* as per RFC1122 4.2.3.5 */
But it is not recommended, because it violates the RFC1122
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jianwu,
The RTCS setsockopt() API permits the application to set the OPT_CONNECT_TIMEOUT option on a stream socket, which indicates the timeout (in millisec.) when a call to the connect API using that socket will return indicating a connection time-out error.
The RTCS User's Guide appears to indicate the value specified for the OPT_CONNECT_TIMEOUT option is to be >= 180000 msec.
You can change TCP_SENDTIMEOUT_MIN (tcp_prv.h) to your expected value
#define TCP_SENDTIMEOUT_MIN 100000L /* as per RFC1122 4.2.3.5 */
But it is not recommended, because it violates the RFC1122
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,Sol
Thanks for your quickly reply.
I modified the macro "TCP_SENDTIMEOUT_MIN",now it works.
When the value is modified,what bad things can happen?
Best Regards.
Need help,thanks.