Hello everybody. I have a question. I try to use NetLibSelect function for
checking if data came in to the device. Function works OK if size of the
receiving data less than 2K (1 packet). However if it more than 2K
(multiple packets) it never notifies. It works OK on emulator, but real
device does not. I use Minstral wireless modem, so it shows me that it
receives data, but function does not responses for it. Here is my code.
Err nErrno = 0;
NetFDSetType readFDs = 0;
WORD nWidth = 0;
Int16 nNumFDs = 0;
netFDZero(&readFDs);
netFDSet(sysFileDescStdIn, &readFDs);
netFDSet(m_Sock, &readFDs);
// Calculate the max descriptor number and use
// that +1 as the max width.
// Alternatively, we could simply use the
// constant netFDSetSize as the width which
// is simpler but makes the NetLibSelect call
// slightly slower.
nWidth = sysFileDescStdIn;
if (m_Sock > nWidth) nWidth = m_Sock;
// Wait for read descriptor to be ready
nNumFDs = NetLibSelect (AppNetRefnum, nWidth + 1, &readFDs,
NULL, NULL, SysTicksPerSecond() / 5 , &nErrno);
// Check for error
if (nNumFDs < 0)
{
return false;
}
// Check for timeout
else if (nNumFDs == 0)
{
return false;
}
// we have data in.
else if (nNumFDs > 0 && netFDIsSet(m_Sock, &readFDs))
{
return GetDataFromSocket();
}
return false;
Any ideas will be appreciated.
Thanks a lot.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/