AW: [En-Nut-Discussion] Problems with NutTcpReceive

Ernst Stippl ernst at stippl.org
Wed Nov 16 22:24:39 CET 2005


Hi Markus!

I am not especially good at C, but try  

if (( data = NutTcpReceive(sock,in_data,sizeof(in_data)-1))!= 0)

instead of

if ( data = NutTcpReceive(sock,in_data,sizeof(in_data)-1)!= 0)

Do you recognize the additional braces? Maybe they influence the sequence in
which the statemant is executed.

regards
Ernst

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von
markusklemt at gmx.de
Gesendet: Dienstag, 15. November 2005 21:11
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] Problems with NutTcpReceive

Hi, I am from germany my english isn´t so good

I have Problems withe the function " NutTcpReceive" or "NutTcpDeviceRead"

I have in my program a while loop.
I ask, have the PIND changed
and then I ask,

if ( data = NutTcpReceive(sock,in_data,sizeof(in_data)-1)!= 0)
  {
	if (in_data == ....)
		{
			do anything;
		}
	if (in_data == ....)
	{
			do anything
	}

	}

The while loop works, but ist stops at the function ---- if ( data =
NutTcpReceive(sock,in_data,sizeof(in_data)-1)!= 0)----

if I receive an String on "sock" the loop does work one times more and stops
at the same position again and again.

Can someone help me?

Thanks

Markus






_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list