Behavior of RTCS "OPT_SEND_TIMEOUT"

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Behavior of RTCS "OPT_SEND_TIMEOUT"

1,598 次查看
fcw
Contributor IV

I'm setting OPT_SEND_TIMEOUT on a blocking socket. If the receiving application or network goes down when sending data, I'd expect to either see an RTCS_ERROR return or maybe a count of the number of bytes accepted. What I see in either of those two cases is no return from send(). If I close the receiving app, which shuts down the receiving socket before exiting, RTCS reports an error as expected.

Is this a bug, awkward/incorrect English in the manual description, or non-standard behavior by RTCS? The OPT_SEND_TIMEOUT description in the RTCS user manual states:

• Zero (RTCS waits indefinitely for outgoing data during a call to send()).

• Non-zero (RTCS waits for this number of milliseconds for incoming data during a call to send()).

"Waits indefinitely for outgoing data" could mean "wait until outgoing data is buffered," but waiting for "incoming data" does not seem to make sense.

The work-around is to set the MSG_DONTWAIT flag and require the sending application to deal with partial send() results, but OPT_SEND_TIMEOUT should be doing that work on behalf of the application code...

Thanks!

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

1,172 次查看
soledad
NXP Employee
NXP Employee

Hello Fred,

RTCS was changed in the different MQX releases. Could please let me know which MQX version are you using??

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复