> 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

Reply via email to