lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #6930] Implement SO_LINGER


From: Simon Goldschmidt
Subject: [lwip-devel] [task #6930] Implement SO_LINGER
Date: Thu, 28 Jun 2007 14:54:24 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #11, task #6930 (project lwip):

Magnus Berglund wrote on lwip-devel:

I've been seeing some strange behaviour in 1.2.0 related to the fact that
do_close does not call tcp_close if the state is ESTABLISHED.

What happens is the following:

1. The app calls:
   netconn_write() (a couple of time really fast),
   netconn_close()
   netconn_delete()

2. netconn_write() fills up the send queue to TCP_SND_QUEUELEN
   The loop condition in netconn_write loops until there is room on the
sendqueue.

3. netconn_close() does nothing in do_close() since the state is
ESTABLISHED.

4. netconn_delete()/do_delconn() does the following:
   - Calls tcp_close(). At this time the send queue is still full since no
ack has been
     received for the sent packets. tcp_close() will therefore fail with
EMEM.
   - tcp_abort is called, and the connection is aborted.

I have done a similar patch to your patch to do_close, and this seems to fix
my problem.
This is due to the fact that netconn_close will loop and wait for space to be
available on the sendqueue before returning.

I think your patch to do_close is correct since tcp_close handles all the pcb
states.
But I think maybe a loop similiar to the one in netconn_close is still
needed. Otherwise, if the sendqueue is full the close will fail.

What do you think?


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6930>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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