I'm using NetLibSelect to block while waiting for input on either a 
network socket or stdin (eg penDown etc). I'm passing a timeout value of 
SysTicksPerSecond() - so it should timeout after 1 second... but it 
doesn't... :-(

Any ideas? Here's a code snippet...

NetFDSetType rFDs, wFDs, eFDs;
SWord numFDs;
Word MaxRefNum = sysFileDescStdIn;
Word timeOut = SysTicksPerSecond();

netFDZero( &rFDs );
netFDZero( &wFDs );
netFDZero( &eFDs );

netFDSet( sysFileDescStdIn, &rFDs );
netFDSet( mySocketRef, &rFDs );

if ( mySocket > maxRefNum )
     maxRefNum = mySocket;

numFDs = NetLibSelect( myNetRefNum, maxRefNum + 1, &rFDs, &wFDs, &eFDs, 
timeOut, &mtNetError );

if ( numFDs == 0 )  // timout has occured
{
     // Do something...
}

It never seems to timeout, so the 'if' test never evaluates to true... 
also it only *seems* to respond to user events the first time round... ie 
network events on the socket don't cause NetLibSelect to return... after 
an initial whack on the screen with my stylus it will then start 
responding to incoming network events on the socket...

My brain hurts... :-(

Gavin.

Reply via email to