Hi everyone
I use the ndk_2_22_01_14 and the nsp_1_10_01_06 in the context of sys/bios.I use the XGCONF for configuration.when i test the ndk_evm6748_coff_helloWorld.It can works fine.But when i modify the following code use tcp protocol .Connect it in client side and send data one time .the message TCP: Retransmit Timeout occurs.what can i do to solve this problem.
void netOpenHook() { // Create our local server
htcp = DaemonNew( SOCK_STREAMNC, 0, 7, dtask_tcp_datasrv, OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );
}
void netCloseHook() {
DaemonFree( htcp );
}
int dtask_tcp_datasrv( SOCKET s, UINT32 unused )
{ struct timeval to; int I; char *pBuf; HANDLE hBuffer;
(void)unused; // Configure our socket timeout to be 5 seconds
to.tv_sec =3;
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 );
for(;;)
{
I = (int)recvnc( s, (void **)&pBuf, 0, &hBuffer );
// If we read data, echo it back
if(I > 0)
{
if(send( s, pBuf, I, 0) < 0 ) break;
recvncfree( hBuffer );
} // If the connection got an error or disconnect, close
else break;
}
fdClose( s );
// Return "0" since we closed the socket
return(0);
}
Using default MAC address Using MAC Address: 00-08-ee-03-14-99
MAC Address = 00-08-ee-03-14-99
EMAC should be up and running
Network Added: If-1:192.168.0.139
�Link Status: 100Mb/s Full Duplex on PHY 0
00015.200 TCP: Retransmit Timeout
Network Removed: If-1:192.168.0.139