[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Detect RST when using non blocking read.
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] Detect RST when using non blocking read. |
Date: |
Mon, 07 May 2012 16:28:23 +0200 |
"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