lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Detecting remote close when using netconn API


From: Krzysztof Wesołowski
Subject: [lwip-users] Detecting remote close when using netconn API
Date: Thu, 12 Apr 2012 00:44:48 +0200

Hi,

I am using netcon api in simple application. Device is a server
processing connections in loop, PC is a client. After PC establishes
connection we go into simple loop:

    while (err == ERR_OK) {
        if (streaming_enabled()) {
            err = netconn_write(pc,sbuf, 1152, NETCONN_COPY);
        }
        vTaskDelay(1);
    }

where pc is struct netconn *.

However if streaming is disabled, there is now way we can detect that
PC sent FIN and closed connection - so subsequent connection to same
port to server causes RST (we are still in inner loop so we cannot
accept next connection).

What can i do to detect that PC closed connection? I do not mean
Ethernet layer error and other "hard do diagnose in few miliseconds"
problems, rather typical situation with connection closed by PC.

Regards,
Krzysztof Wesołowski,



reply via email to

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