On 21 Oct 2014, at 3:52 , Luc Fabresse <luc.fabresse@gmail.com> wrote:
2014-10-21 15:40 GMT+02:00 Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu>>:
On 21 Oct 2014, at 15:29, Luc Fabresse <luc.fabresse@gmail.com <mailto:luc.fabresse@gmail.com>> wrote:
yes examples are good. but I also suggest to use a stream on a UDPSocket instead of manipulating the socket directly in the model code. Usually, it lowers the code complexity.
Hmm, are you sure that is even possible with UDP sockets ?
I was thinking of using a stream on the data part of the datagram packets. If you have structured data it simpler to use #next or #nextImage, ...
And if the data part is bigger than one datagram packet (65535 IIRC), you can append to the stream as soon as you receive the next packet.
Does it sounds good?
Cheers,
Luc
UDP delivery isn't ordered, nor reliable. Build those into a Stream wrapper in order to reliably reconstruct a data stream from the sender, and you're almost back to TCP... Cheers, Henry