[En-Nut-Discussion] Thread stops executing after some time.

Erik L erik.lindstein at gmail.com
Wed Apr 2 10:21:21 CEST 2008


Because of the long time it takes before i can see the result of the tests
only the ones without debuging of the pointers have falled now. 

But i did get some interesting info out of that one.
The printout i get from the one that faild is the following (I listed the
sockets 3 times)

-----------
222 List of sockets

(DEAD SOCKET)
SYN SENT        220F     TCP     192.168.0.112:6130      192.168.0.115:9050
last_error:0    so_retran_time:0        so_rtto:1000    so_retransmits:2,      
NutGetMillis:35943

(ME CONNECTED)
ESTABLISHED     2181     TCP     192.168.0.112:23        192.168.0.115:15293
last_error:0    so_retran_time:0        so_rtto:612     so_retransmits:0,      
NutGetMillis:35946

s
222 List of sockets

SYN SENT        220F     TCP     192.168.0.112:6130      192.168.0.115:9050
last_error:0    so_retran_time:0        so_rtto:1000    so_retransmits:2,      
NutGetMillis:38312

ESTABLISHED     2181     TCP     192.168.0.112:23        192.168.0.115:15293
last_error:0    so_retran_time:0        so_rtto:542     so_retransmits:0,      
NutGetMillis:38315

s
222 List of sockets

SYN SENT        220F     TCP     192.168.0.112:6130      192.168.0.115:9050
last_error:0    so_retran_time:0        so_rtto:1000    so_retransmits:2,      
NutGetMillis:39424

ESTABLISHED     2181     TCP     192.168.0.112:23        192.168.0.115:15293
last_error:0    so_retran_time:0        so_rtto:500     so_retransmits:0,      
NutGetMillis:39426
---------

So one can see that se socket just gets stuck there.
But i did add the following code bellow just to test if i could kick the
socket in the a*s and get it working again. And it worked, so by using the
kill command the socket / NutTcpConnect came thru and the thread started
execute again. 

----
        if (strncmp("kill", buff, got) == 0) 
        {
					extern TCPSOCKET *tcpSocketList;					
					TCPSOCKET *ts;
					for (ts = tcpSocketList; ts; ts = ts->so_next)
					{
						switch (ts->so_state) 
						{
			        case TCPS_SYN_SENT:
								NutEventBroadcast(&ts->so_rx_tq);
								NutEventBroadcast(&ts->so_pc_tq);
								NutEventBroadcast(&ts->so_ac_tq);
			        	fputs("Posting event to kill socket..\r\n", stream);
			        break;
		        }
					}
					continue;
        }
----


After i run that code i get:
--------------
222 List of sockets

SYN SENT        220F     TCP     192.168.0.112:6130      192.168.0.115:9050
last_error:0    so_retran_time:0        so_rtto:1000    so_retransmits:2,      
NutGetMillis:19124

ESTABLISHED     2181     TCP     192.168.0.112:23        192.168.0.115:15293
last_error:0    so_retran_time:0        so_rtto:360     so_retransmits:0,      
NutGetMillis:19127

kill
Killing sockets

s
222 List of sockets

ESTABLISHED     2181     TCP     192.168.0.112:23        192.168.0.115:15293
last_error:0    so_retran_time:0        so_rtto:334     so_retransmits:0,      
NutGetMillis:40380
--------------

So the question is why don´t NutEventBroadcast get called (as i guess it
should.)

Regards/Erik




Henrik Maier wrote:
> 
>> -----Original Message-----
>> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
>> bounces at egnite.de] On Behalf Of Erik L
>>
>> Also i'm not sure how to debug this ones:
>> sock->so_tx_nbq
>> sock->so_ac_tq
> 
> They are both pointers, so fprintf(stream,"nbq=%p tq=%p\n",
> sock->so_tx_nbq,
> sock->so_ac_tq) should do the job. In only want to know if they are 0,
> 0xFFFF or anything else.
> 
> Henrik
> http://www.proconx.com
> 
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> 

-- 
View this message in context: http://www.nabble.com/Thread-stops-executing-after-some-time.-tp16299152p16444798.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list