On dm642 platform, use the ndk api to build a server.
when the program run to fdSelect() , it was always blocked even the time is out, the last parameter of fdSelect has been as below
FD_ZERO(&ibits);
FD_SET(slisten, &ibits);
timeout.tv_sec = 5;
timeout.tv_usec = 0;
retValue = fdSelect(1, &ibits,0, 0, &timeout );//never go down
if the timeout structure is reset to 0 , no blocking happened,
this also happened in func Sent(), if these is some exception in network(pluck the cable manually),
the program was blocking , there was no return from Sent(),
though i've set the parameter
nNetTimeout.tv_sec = 5;
nNetTimeout.tv_usec = 0;
setsockopt( slisten, SOL_SOCKET, SO_SNDTIMEO, nNetTimeout,sizeof(nNetTimeout) );
setsockopt( slisten, SOL_SOCKET, SO_RCVTIMEO, nNetTimeout,sizeof(nNetTimeout) );
i've puzzled by this problem for a few weeks ,
Anybody who knows gives some help, thank you!