[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Detecting remote close in lwip
From: |
Gisle Vanem |
Subject: |
Re: [lwip-users] Detecting remote close in lwip |
Date: |
Sat, 04 Aug 2012 14:18:03 +0200 |
"Sanchayan" <address@hidden> wrote:
Is there a way of detecting a connection which has been closed by the
remote host?
I have written a client for connecting to a remote host, but, i need to
know when the connection has been closed by the application running on
the PC or on any kind of connection error.
Well that depends on the protocol used; tcp or udp or something else?
But even if you use TCP, it's generally not possible to conclude your
peer died unless you use some kind of heart-beat signal (1 byte NOP
command in your protocol). TCP keepalives are also nice.
And define "close". If you use TCP and the peer did an active close,
you side should have detected that (unless there's a network loss).
That's why there is a TCP CLOSEWAIT state.
--gv