Hello again.
I'm trying to make my board (TMDXEVM6670L) to send packets to my PC, using following code:
for(;;)
{
tmp = sizeof( sin1 );
i = (int)recvnc( s, (void **)&pBuf, 0, &hBuffer );
printf(pBuf);
printf("\n");
poutbuf = outbuf;
if( i >= 0 )
{
for (j = 1; j < 100; j++)
{
outval = j;
ltoa(outval, poutbuf);//
if (j < 10)
{
sendto(s, poutbuf, 1, 0,(PSA)&sin1, sizeof(sin1) );
printf(poutbuf, "\n");
platform_delay(40000); // 0.04 sec
}
if (j >= 10 && j <100)
{
sendto(s, poutbuf, 2, 0,(PSA)&sin1, sizeof(sin1) );
printf(poutbuf, "\n");
platform_delay(40000);
}
if (j >= 100 && j < 1000)
{
sendto(s, poutbuf, 3, 0,(PSA)&sin1, sizeof(sin1) );
printf(poutbuf, "\n");
platform_delay(40000);
}
if (j >= 1000 && j < 10000)
{
sendto(s, poutbuf, 4, 0,(PSA)&sin1, sizeof(sin1) );
printf(poutbuf, "\n");
platform_delay(40000);
}
}
sendto(s, 0, 0, 0,(PSA)&sin1, sizeof(sin1) );
recvncfree( hBuffer );
}
else
break;
}
The problem is, that operations do not work inside the loop, until the loop itself does not end. I need to send a large amount of packets like that, and i don't know why this is happening. Could you please help me to understand, how to rework this code properly?