Connect to TCP Server time-out issue.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Connect to TCP Server time-out issue.

ソリューションへジャンプ
2,001件の閲覧回数
tongjianwu
Contributor III

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. 

0 件の賞賛
返信
1 解決策
1,703件の閲覧回数
soledad
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,704件の閲覧回数
soledad
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,703件の閲覧回数
tongjianwu
Contributor III

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.

0 件の賞賛
返信
1,703件の閲覧回数
tongjianwu
Contributor III

Need help,thanks.

0 件の賞賛
返信