lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Detect RST when using non blocking read.


From: Karlsson, Johnny
Subject: Re: [lwip-users] Detect RST when using non blocking read.
Date: Mon, 7 May 2012 17:45:15 +0200

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: address@hidden
[mailto:address@hidden 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" <address@hidden> 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
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]