OK, I track deeper in the source
The reason lwip_recv still blocks even the flag says NOWAIT is because that
sock->rcvevent is Non-zero. Yet, at this point, all incoming TCP packets
have been received, the only extra packets are those tcp window updating
packets, which should not increase the rcvevent for TCP connection.
Since sock->rcvevent is not zero, lwip_recv calls netconn_recv to fetch the
data, yet, there is no data, so it waits there until connection is closed
or something comes in.
I believe lwIP has a problem here
Capture file:
http://www.dataq.com/chen/new.cap
Thanks
>>>>>>>>>>
The program is supposed to send out data continuously once the connection
is made.
With telnet, Wireshark will not capture these tcp window updating packets,
and the program works as expected.
With a 3rd-party telnet-like program, which I am trying to investigate
more, Wireshark will capture these tcp window updating packets, and the
lwip will stay in the call to nbytes=lwip_recv(clientfd, buffer,
sizeof(buffer),8), and won't get out of it until I close the connection,
even though the flag for lwip_recv is NOWAIT.
nbytes=lwip_recv(clientfd, buffer, sizeof(buffer),8) is also called in the
above telnet case, and it will not block the process
Thanks
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users