[riot-notifications] [RIOT-OS/RIOT] sock: tcp: fix sock_tcp_read() example (#16743)

Marian Buschsieweke notifications at github.com
Mon Aug 16 11:23:14 CEST 2021

Maybe it is worth to discuss the correct behaviour first.

But note: Both POSIX `read()` and `recv()` return 0 at end of file/stream. For that reason, they had to introduce non-error error-codes for nonblocking operation to indicate that no data is available yet. This kind of proves that not using an error code for EOF / closed connection was a bad idea. But still, since the SOCK API was modeled after BSD sockets, I think there will be some confusion with different behaviour.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210816/755f5151/attachment.htm>

More information about the notifications mailing list