I use VC6.0 write a program to send 20 MB data to 6678EVM. But it is only about 16MB of data received and an error occurred. I have tried many times and the recv () function returns a value of 0 or -1.Test result when I only send and receive data 10MB is correct.I use the TCP protocol.And NDK settings are configured in accordance with routine.
DSP-side part of the program are as follows:
to.tv_sec = 4;
to.tv_usec = 0;
setsockopt( s, SOL_SOCKET, SO_SNDTIMEO, &to, sizeof( to ) );
setsockopt( s, SOL_SOCKET, SO_RCVTIMEO, &to, sizeof( to ) );
i = 1;
setsockopt( s, IPPROTO_TCP, TCP_NOPUSH, &i, 4 );
while(1)
{
i = (int)recv( s, &length, sizeof(int), 0);
count = 0;
if(length > 0)
{
while( count < 1024*1024*20 )
{
i = (int)recv( s, (TcpRcvData+count), 1024*1024*20, 0);
if(i > 0)
count += i;
}
count = 0;
length = 0;
}
}
VC-side part of the program are as follows:
Send((char*)pBuff,1024*1024*20,0);