lwip_recvfrom - EWOULDBLOCK error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

lwip_recvfrom - EWOULDBLOCK error

matteo.cogi@alice.it
 

Dear all,

I have some difficult in the use of lwip_recvfrom function.

I have been using the LwIP 1.4.1 for several years and it works great.

I recently replaced the version 1.4.1 with the 2.0.3 and encountered some difficults with the lwip_recvfrom function. In the version 1.4.1, when the connection isn’t blocking and there is no data available then an EWOULDBLOCK error is set for that socket (sock_set_errno). Instead, in the version 2.0.3, in the same conditions, an EWOULDBLOCK error is set for errno variable (set_errno).
According the bug #49848 and task #14275, this change seems to depend on 
Open Group Standard.
My project is based on a RTOS with several tasks and each of them manages a socket. Because the errno is a global variable, the errno contains the last error reported by a socket, so the error contained in the errno could be overwritten in the instance of checking the errno.

A this point my question is if there is a method for associate the EWOULDBLOCK error to a specific socket. In this way I could check the error later on compared to the occurrence of the error and I’m sure that error is associated to that socket.

Thanks in advance for any support or advice.

Regards


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_recvfrom - EWOULDBLOCK error

goldsimon@gmx.de
On 03.10.2018 10:42, [hidden email] wrote:
[..]

My project is based on a RTOS with several tasks and each of them manages a socket. Because the errno is a global variable, the errno contains the last error reported by a socket, so the error contained in the errno could be overwritten in the instance of checking the errno.


In a multithreaded environment, 'errno' has to be a thread-local variable, not a global one.

A this point my question is if there is a method for associate the EWOULDBLOCK error to a specific socket.


Hmm, no, I don't know of any, sorry.


Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_recvfrom - EWOULDBLOCK error

goldsimon@gmx.de
On 03.10.2018 14:24, [hidden email] wrote:
On 03.10.2018 10:42, [hidden email] wrote:
[..]

My project is based on a RTOS with several tasks and each of them manages a socket. Because the errno is a global variable, the errno contains the last error reported by a socket, so the error contained in the errno could be overwritten in the instance of checking the errno.


In a multithreaded environment, 'errno' has to be a thread-local variable, not a global one.

A this point my question is if there is a method for associate the EWOULDBLOCK error to a specific socket.


Hmm, no, I don't know of any, sorry.

But if you could provide us with information about how this is implemented in other systems (if you find any), I'd be happy to implement this for lwIP. I know the current situation might not be optimal for small embedded sytems (implementing thread-local storage), but I'm really trying to follow the socket specs here...

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users