My application requires that netconn_recv() be non-blocking and to
return immediately of there is no message waiting.
So I modified sys_arch.c to convert small timeout values to zero for the
queue wait.
But I run into problems if the xQueueReceive timeout is 0. The TCP
connection closes after ~5 netconn_recv calls. Everything works fine if
the xQueueReceive blocks for at least 1 tick.
Does the lwIP architecture REQUIRE that netconn_recv allow the lwIP
thread to run?
Is there a reason that it was designed such that a timeout of 0 means
wait forever instead of peek?
Here's my modification to sys_arch.c:
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
{
...
if ( timeout != 0 )
{
timeout >>= 2; <<<<<---- added this line which converts
timeout in ms to ticks
if ( pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )
...
Thanks
-Dave
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users