[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] How to force-close a netconn from the server side?
From: |
Freddie Chopin |
Subject: |
Re: [lwip-users] How to force-close a netconn from the server side? |
Date: |
Thu, 26 Jan 2017 16:59:08 +0100 |
On Thu, 2017-01-26 at 15:42 +0100, address@hidden wrote:
> > [..] It works only if I
> > introduce a small delay between close+delete and opening of new
> > listen
> > connections (I'm using a multithreading system).[..]
> > With this code the PCBs are only sometimes stuck in TIME_WAIT state
> > for
> > ~2 minutes. But if I remove the "sleepFor()" call, then there is a
> > PCB
> > (maybe more than one) stuck in FIN_WAIT_1 forever.
>
> That's not strange, and has nothing to do with the tcpip-thread
> runningĀ
> but with receiving the remote host's FIN+ACK.
> FIN_WAIT_1 says that our FIN has been sent while TIME_WAIT says theĀ
> FIN+ACK has been received (and ACKed) so the
> connection is fully closed.
But what difference in reception does it make - in both cases
(with/without delay) the netconns are closed and deleted anyway. The
only difference is that in the "working" case I wait for a second
before establishing new listening netconns, while in the "failing" case
I try to bind them immediately (which fails without SO_REUSE).
Regards,
FCh