Thanks Lukas. It's same when I don't use CanRead func. I found something strange like this: When I use Sleep(1) function in repeat-until block, the program can read every 10 ms. But only Windows Home Edition.* *So I* *don't use Sleep function ;)*
* On Tue, Dec 15, 2009 at 5:42 PM, Lukas Gebauer <[email protected]> wrote: > > UDP data comes every milliseconds from the device. > > I can receive data every ten milliseconds. I'm sure that the data come > > faster. Because I can see the data on WireShark. But my program can > > read every ten milliseconds. So data lost occurs in my program. > > Problem can be insice CanRead. It calls Select function form Winsock > API. This function is wait function - its waiting until some data can > be readed. I not know how it is written internally, but is possible > some delay here. > > Try to do experiment: > > Call WaitingData function firts. It return size of firts readable > datagram in the queue. When you get non-zero result, then call > RecvBuffer without any CanRead call! (Additionally, you can use > length from WaitingData for RecvBuffer...) > > When WaitingData returns zero, then no datagrams are in the queue and > you can call CanRead here and wait for some new datas. > > > > -- > Lukas Gebauer. > > http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib. > http://geoget.ararat.cz/ - Geocaching solution > > > > ------------------------------------------------------------------------------ > Return on Information: > Google Enterprise Search pays you back > Get the facts. > http://p.sf.net/sfu/google-dev2dev > _______________________________________________ > synalist-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/synalist-public >
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev
_______________________________________________ synalist-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/synalist-public
