Thanks Matthias, now I see your point. I'm wondering why we should prepend a length to each datagram. On the datagram's header the payload length is already present, should not be enough to reconstruct the original datagram after the stream has been unwrapped? Cheers, Gianluca