[PD] tcpclient sending more than 1 send at once

Martin Peach martin.peach at sympatico.ca
Mon Sep 8 18:18:26 CEST 2008


Roman Haefeli wrote:
>
>Martin Peach wrote:
> > Yes, and [unpackOSC] has no way of knowing if it is getting data from
> > UDP or TCP so it should probably assume the worst and go for TCP. In
> > fact, to be unbreakably robust it should assume it is getting input one
> > byte at a time and not output anything until either an entire OSC packet
> > has been received or the packet is not valid OSC.
>
>this is how i would like [unpackOSC] to behave. i don't see any other
>way to do OSC over tcp.
>

I think opening a bundle and putting all the simultaneous messages in it, 
then closing the bundle and sending it, will work over tcp.

In practical terms a byte-wise [unpackOSC] would have to copy incoming bytes 
into a buffer and repeatedly attempt to parse them as an OSC message until 
the entire message had been received. The overhead of doing this would waste 
a lot of cpu.

If a tcp packet always contains an integral number of OSC packets it's a 
little easier, we just have to check for more packets in the buffer.

I would try the bundle approach first...

Martin






More information about the Pd-list mailing list