> We don't understand each other when speaking about datagram, I'm not using
> "datagram based" communication, my camera (which I can't modify) send
> those UDP "packets" if you prefer, which are transmitted in 1514 byte
> fragments , but this should be transparent to the program as those packets
> are reassembled at the OS level.

Do not mix datagram with frames. Frames does not matter, because we are 
operating on packet level.

UDP = "User DATAGRAM Protocol" It is based on sending datagram packets. 
(see: http://en.wikipedia.org/wiki/User_Datagram_Protocol) 

And each datagram packet have limited maximum size. Technically it is 
nearly 64kB on IPv4. But maximum datagram size is limited by an operating 
system too! It is indicated by iMaxUdpDg member of WSAdata structure. 

Check TUdpBlockSocket.WSAdata.iMaxUdpDg value... it is 8192 in your case, 
am I right? So, then you cannot use larger UDP datagram. UDP is designed 
for small data, not for large data transfers.

In Synapse TUDPBlockSocket practise - one send operation made one 
datagram on the wires. (it can be just one byte of data, or more... up to 
iMaxUdpDg.) One Recvpacket call receive one datagram from reading queue. 
Dunno how it is big. You got full datagram by one call.

Using other receiving funtiocn working too (because it using recvvPacket 
on the background), but it is not reliable! UDP datagram can be lost - do 
not forget it!

What happen, when you wish to read X bytes, but some datagram was lost? 
Missing bytes is readed from the beginning of next image and you are 
totally unsychronized! It is worst kind of error, because your program 
working fine... until first data lost occurs. Then your program do crazy 
things.

You must read data by recvpacket. You must examine each received packet 
and try to find begin of your image on the begin of received datagram.  
Then add all next datagrams into your image data, until you find next 
starting datagram. Sometimes you can get invalid image, but you are 
always synchronized.

--
Lukas Gebauer.

http://synapse.ararat.cz/ - Synapse Delphi and Kylix TCP/IP Library
http://geoget.ararat.cz/ - Geocaching solution



------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to