Ok, that seems much better. But one more question .. You write that
there is a global variable 'errno', but isn't there one errno variable
for each socket? If so how do I access it? The only function seems to be
to get the socket (get_socket ) but that is a static method.

/Johnny

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On
Behalf Of Simon Goldschmidt
Sent: den 7 maj 2012 16:28
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Detect RST when using non blocking read.

"Karlsson, Johnny" <[email protected]> wrote:
> There doesn't seem to be a way to detect that a remote host sends a
RST
> message when using non blocking read.

That doesn't depend on blocking or nonblocking, it's the way the socket
API is defined. When a receive function returns:
- 0, the remote host closed the connection
- >0, data was received,
- <0, there has been an error. To find out which error, you have to look
at the global variable 'errno'. E.g. for a receive timeout on a
nonblocking socket, this would be 'EAGAIN'.

Also, this is not lwIP specific but generally valid for sockets.

Simon
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

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

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

Reply via email to