[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Handling dead TCP connection
From: |
Thomas Johansen |
Subject: |
[lwip-users] Handling dead TCP connection |
Date: |
Thu, 17 Jan 2013 11:30:44 +0100 |
Hi All
How do I handle dead TCP connection best in lwIP?
It is not always detected by the stack that the connection is lost.
So therefore we have a high level keep alive.
In cases of failed keep alive I do a netconn_disconnect(xNetConn) and then a
netconn_close(xNetConn), before I try reconnect.
If I kill the TCP listen server (PC application), I get an error -11
(connection reset) ot -12 (Connection close) depending on how I close it.
I then call netconn_close(xNetConn) netconn_delete(xNetConn).
Then I invalidate the net connection (xNetConn = NULL ) and start binding again.
I the sometime get and LWIP asset: IP.c linie 755
/* pbufs passed to IP must have a ref-count of 1 as their payload pointer
gets altered as the packet is passed down the stack */
LWIP_ASSERT("p->ref == 1", p->ref == 1);
I If just do a netconn_delete(xNetConn) and then I try reconnect I get a
hardfault.
I guess I'm asking for any "best practice" on how to handle TCP connection
error from lwIP and how to handle them lwIP style.
(delete, close, bind etc combination)
Thomas Johansen
______________________ Appended by AGRAMKOW Fluid Systems A/S
_______________________
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is
solely intended for the named addressee (or a person responsible for delivering
it to the addressee). If you are not the intended recipient of this message,
you are not authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this e-mail in error, please notify the
sender Immediately by return e-mail and delete it from your computer.
****************************************************************************
This e-mail has been scanned by http://www.comendo.com and does not contain
virus.
****************************************************************************
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] Handling dead TCP connection,
Thomas Johansen <=