----- Original Message ----- 
From: "stefano d'urso" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 2004 5:38 AM
Subject: the application needs to wait... why?


> i've got a problem with this operation:
>
> while(1) {
>   const int bufSize=0x100;
>   UInt8 buf[bufSize];
>   UInt16 bytesRead=sk.receiveData(buf,sizeof(buf));
>  [...]
> }
>
> the function receiveData receives datas from a socket. if i place a
> breakpoint just before the receiveData and i debug my application
evertthing
> is ok, but if i run my application the receiveData is not able to receive
> data correctly
>
> if i place a cycle like this:
>
> for (int i=0;i<SysTicksPerSecond()/0.008;i++) {}
>
> before the receiveData, everything is ok... the problem is that i'd like
to
> know why i need to place this additional code and i'd like to know if
> there's a real way to find this delay time, in fact i experiment this
delay
> time doing tests. and also: this delay time will be suitable for all of
the
> handheld?!?!


I think either you use non-block socket or the timeout is too small.
In the first case, NetLibReceive returns netErrWouldblock, you may need some
logic to decide if you want to continue to wait or not. In the second case
netErrTimeout will return and you may need to increase this value.

Vu



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to