[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] lwip_recvfrom(sock == 0)
From: |
address@hidden |
Subject: |
Re: [lwip-devel] lwip_recvfrom(sock == 0) |
Date: |
Sat, 26 Sep 2020 13:32:57 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
Am 26.09.2020 um 09:54 schrieb Gisle Vanem:
> goldsimon@gmx.de wrote:
>
>>> Now the MicroPython test hangs forever. Nothing happens
>>> with this socket 0. It's unconnected, so how could this socket
>>> ever receive a single byte?
>>
>> It should indeed not wait here, but return an error. Would you mind
>> adding a bug in our savannah bugtracker to ensure this does not get
>> forgotten?
>
> Done at:
> https://savannah.nongnu.org/bugs/index.php?59182
>
>>> Could it be some of my 'LWIP_x' options are messed up?
>>
>> Hmm, while this could change with options, it still should not behave
>> like you saw.
> Adding a:
> #define LWIP_SOCKET_OFFSET 100
>
> for a socket fd to start at 100, did not help.
> But it looks better than a socket 0. IMHO lwip_socket()
> returning 0 is highly confusing.
Why? File descriptors are >= 0. That's what the spec says:
https://pubs.opengroup.org/onlinepubs/009695399/functions/socket.html
Regards,
Simon