[En-Nut-Discussion] Ethernut as TCP Client stops trying to connect after a while.

Erik Lindstein erik at ledutveckling.com
Tue Mar 11 09:18:45 CET 2008


(Sorry to ask this realy stupid question but what am i doing wrong
that makes my replys end up as new topics on the list instead of
creating a thread)

Il try to check the memory issue and se what i come up with.

But Im not getting any smarter by the test i just did.
---------------------------

				if ((socket = NutTcpCreateSocket()) != 0)
				{
					NutTcpSetSockOpt(socket, SO_RCVTIMEO, &tmo, sizeof(tmo));
					NutTcpSetSockOpt(socket, SO_SNDTIMEO, &tmo, sizeof(tmo));
					if(NutTcpConnect(socket, rip, TCPSERVERPORT) == 0)
					{
						stream = _fdopen((int) ((uptr_t) socket), "r+b");
						if(stream != 0)
						{
                                                    // Use Socket to
exchange data.
						}
						no_connection_count = 0;
					}
					else
					{
						if(no_connection_count++ > MAX_CONNECTION_RETRY)
						{
							data_exchange_timeout = TCP_CLIENT_NO_CONNECTION_TIMEOUT;
							no_connection_count = 0;
						}
						socket_error = NutTcpError(socket);
						sprintf(info_text ,"Conn error:%d\nCount:%d", socket_error,
no_connection_count);
					}				
					NutTcpCloseSocket(socket);
				}
				else
				{
						sprintf(info_text ,"No socket");
				}
-- 

But when the client stops connecting I still just read the old "Conn
error:%d\nCount:%d" not the "No socket" text.
So then it looks more like either the thread stops returning/executing
after i call NutSleep() or something is changing the config variables
i have but i don´t have any code that alter them.
Well I will remove the use of them now just to make sure they arent the probelm.

Its just that it takes about 24h to se if it made any difference or
not. Just two of my 5 clients dropped out after running sence
yesterday.


Regards
/Erik



More information about the En-Nut-Discussion mailing list