lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] read() returns error ECONNABORTED instead of 0 for closed


From: Stéphane Lesage
Subject: [lwip-devel] read() returns error ECONNABORTED instead of 0 for closed
Date: Sun, 1 Aug 2010 16:39:30 +0200

 
Hi,
 
On my products, I monitor the TCP connections with customized Keep-Alive values.
I also use read time-out, because I need to watch for external events (configuration change or GUI).
So I'm basically using the folowing scheme in a loop:
 
int n = read();
if (n == 0)    goto connection_closed;
else if (n < 0) continue;
else process_data();
 
It's working pretty well, but I recently met the folowing problem:
Sometimes (don't know exactly when, but it seems it happens more with fast polling),
when the tcp connection is broken (keep alive not acked), read() doesn't return 0, instead it returns errno==ECONNABORTED.
 
Is it a normal behaviour, or shall lwip always return 0 when the connection is closed ?
 
--
Stéphane LESAGE
ATEIS International
 

reply via email to

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