In previous version call of socket(AF_INET,.....) to create a socket returned a number less than 32.
This behaviour seems to be "good practice" in other OS.
Actual version for ESP32 adds an offset (LWIP_SOCKET_OFFSET)
I could not find any information about this.
What is the reason for this change, for what can it be used ?
In our application we check the socket ID, which now causes an error.
Question is now, do we have to change our application, or is there any other option ?
change in call of socket (internally lwip_socket)
Re: change in call of socket (internally lwip_socket)
This allows use of the same file descriptor values (and function calls) for both files and for sockets, previously it was tricky (and error prone) if you needed both in the same source file. This was a long-standing issue, discussed a bit here: https://github.com/espressif/esp-idf/issues/273jumjum123 wrote:In previous version call of socket(AF_INET,.....) to create a socket returned a number less than 32.
This behaviour seems to be "good practice" in other OS.
Actual version for ESP32 adds an offset (LWIP_SOCKET_OFFSET)
I could not find any information about this.
What is the reason for this change, for what can it be used ?
What checks are you making? The return value of socket() in BSD sockets (and in IDF, before and after this change) is -1 for an error, and the file descriptor (an int) otherwise. If you change your application to check this, it will work with both versions.In our application we check the socket ID, which now causes an error.
Question is now, do we have to change our application, or is there any other option ?
Re: change in call of socket (internally lwip_socket)
@ESP_Angus there is a chack in core file of our application,m checking of socket ID less than 32.
We could add an #ifdef, to change this for ESP32 only, but thats an ugly solution.
Anyway, I will discuss with Espruino guys
Its 1:00 am for me now, so have a good night
We could add an #ifdef, to change this for ESP32 only, but thats an ugly solution.
Anyway, I will discuss with Espruino guys
Its 1:00 am for me now, so have a good night
Who is online
Users browsing this forum: No registered users and 125 guests