[En-Nut-Discussion] TCP sockets stuck in closing state
cbrumley at polarsoft.biz
Thu May 7 16:33:59 CEST 2015
The thread priorities have been troublesome for me, as well. For example,
increasing the HTTPD thread priority results in some pretty wonky behavior.
Like, you I leave the priorities at the defaults.
Regarding my stuck sockets, I added change to tcpsm.c to handle sockets that
have been in the CLOSING state for too long (in my case, I increment the
so_time_wait variable when the state is CLOSING and if it goes greater than
9, the sockets gets destroyed).
Based on my overnight testing, this has worked very well. To be honest, I
don't if it's resulted in incorrect TCP behavior, but I have noticed any
negative side effects. But, the code no longer leaks heap space and that is
what is important to me. I'd rather the TCP SM have to renegotiate that the
board need to be reset because it has no remaining heap space.
> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Henrik Maier
> Sent: Wednesday, May 06, 2015 7:23 PM
> To: en-nut-discussion at egnite.de
> Subject: Re: [En-Nut-Discussion] TCP sockets stuck in closing state
> Reading your post I now remember that I had a similar effect with sockets
> stuck and it was after I played with changing thread priorities which
> in starving the TCP thread. So your hint is worthwhile to follow up.
> In fact I never had much luck changing Nut/OS thread priorities.
> Whenever I did that it had some side-effect, so I now always leave
> everything at default settings.
> On 7/05/2015 2:07 AM, Stefan Hax wrote:
> > It almost looks like the SM thread doesn't get to run because of a
> > busy loop somewhere.
More information about the En-Nut-Discussion