[En-Nut-Discussion] socket closewait

Harald Kipp harald.kipp at egnite.de
Thu Jan 16 11:55:57 CET 2003

In the first place most apps get blocked because one thread
misses to call NutThreadYield() while running in an endless
loop. More infos are in


Also note, that 2.6.0 fixes a bug in the event handling.
This bug is typically no problem unless the application
depends on no SIGNALED state getting lost.

Finally thread may override the heap, destroying any
kind of internal structure. See


Tracing with JTAG is not very helpful with sporadic errors.
Better rebuild Nut/OS with NUTDEBUG (see Makedefs) defined.

Call at least NutKHeapTrace(1) at the start of your app.
This will add some extra security bytes to each allocated
block to detect overrides. Use a terminal program to store
UART0 outputs. Also look to os/osdebug.c for more useful
debugging routines, specially NutKDumpThreadList().


At 00:26 16.01.2003 -0500, you wrote:
>I thought this went away but it is back....not sure why. I have a socket 
>that stays in the closewait state. I was debugging and the thread that 
>creates and closes the socket stops running, I verified this by calling 
>nutsleep in the thread and watching its activity from an web page. It 
>stays in SLP and the event queue never changes. What would cause 
>this....what am I doing wrong??

More information about the En-Nut-Discussion mailing list