[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #24830] Socket never closed sometimes.
From: |
Kieran Mansley |
Subject: |
[lwip-devel] [bug #24830] Socket never closed sometimes. |
Date: |
Tue, 31 Mar 2009 15:03:16 +0000 |
User-agent: |
Opera/9.21 (X11; Linux i686; U; en) |
Follow-up Comment #5, bug #24830 (project lwip):
Now I come to think about how to fix this, there is a minor problem: data can
be buffered on RX at lots of levels in the stack (within the TCP layer,
netconn layer, and sockets layer). Therefore tcp_close() needs to know if
there are any bytes buffered in the higher layers, but it would be hard for it
to work this out. I therefore think adding a parameter that gets filtered
down through the layers that says "there is buffered data in the layer(s)
above", and then passed to netconn_delete() and tcp_close() would be a good
idea. However, this changes the API and so causes problems that way.
It would be fairly simple to alias the existing API functions to the new
ones, eg:
#define tcp_close(pcb) tcp_close_new(pcb, 0)
#define netconn_delete(conn) -> netconn_delete_new(conn, 0)
(I would choose better names than *_new() - any suggestions?)
This would result in minimal extra code, and keeps the API backwardly
compatible, but is a bit ugly in the long term.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?24830>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/