This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Build a server on DM642, fdSelect() & send() always blocking , never timeout

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!