lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20791] conn->recvmbox might be deleted twice in netco


From: Howell ZHU
Subject: [lwip-devel] [bug #20791] conn->recvmbox might be deleted twice in netconn_delete() and netconn_recv
Date: Thu, 16 Aug 2007 03:25:30 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

Follow-up Comment #3, bug #20791 (project lwip):

Hi Jonathan and Frédéric,
Thank you for the comments and reference you provide!

I think it is a very common method in full-duplex communication application
that one thread is blocked on calling recv and another used to send or close
the connection according to local upper request.

Thus if we want to close the connection locally without invoking
netconn_delete in other thread, there is no chance to unblock recv thread
except for peer's disconnection ACK. However, in some bad situations, the
peer's disconnection ACK might be lost.
So I think such operation MUST be processed in multi threads.

Based on the past discussion, I think this might be a better solution:
In function netconn_close, we signal recv thread that the connection is
closed by sending a NULL message to recvmbox. Thus the recv thread will be
unblocked and detect the disconnection. In following steps, recv thead will
drain the recvmbox and call netconn_delete. Thus the multi-thread operation is
avoided and netconn_recv is unblocked (so we can gracefully close the
connection locally).


How about your opinions?
I'm not very familiar with this project. So I want to discuss it with you
carefully:)


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20791>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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