connect() error in user guide

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

connect() error in user guide

ソリューションへジャンプ
1,540件の閲覧回数
emanueletrapani
Contributor III

hi, i work on mqx 4.2, CW 10.6 and frdmk64f.

in the RTCS user guide, connect() function description, i read that :

"When used with stream sockets, the function fails if the remote endpoint:

...

• Is unreachable, which causes the connection timeout to expire."

when i use connect() function if the remote endpoint is unreachable, the function return when the connect timeout expires but return RTCS_OK. so it seem that the function not fails.

it is correct? how can i understand that the connect fail if the socket are not connect and the function return RTCS_OK?

thanks

ps: it return RTCS_OK also if my application is just one task with just one socket that try cyclically to connect to an inexistent server.

ラベル(1)
0 件の賞賛
返信
1 解決策
1,211件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi Emanuale,

you are right, I was able to reproduce this and it is not the expected behavior. I created a report and submitted to MQX development team. Report number is MQX-5682

meanwhile you can workaround this by activating a watchdog timer that expires before connect timeout. If the connect function is still trying to connect before a considerable time you may kill the task.

Best regards,

Carlos

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,212件の閲覧回数
Carlos_Musich
NXP Employee
NXP Employee

Hi Emanuale,

you are right, I was able to reproduce this and it is not the expected behavior. I created a report and submitted to MQX development team. Report number is MQX-5682

meanwhile you can workaround this by activating a watchdog timer that expires before connect timeout. If the connect function is still trying to connect before a considerable time you may kill the task.

Best regards,

Carlos

0 件の賞賛
返信
1,211件の閲覧回数
emanueletrapani
Contributor III

thanks Carlos.

i use a similar workaround.

0 件の賞賛
返信