[PD] tcpserver buffer size issues
reduzent at gmail.com
Wed May 15 10:52:23 CEST 2013
On Wed, 2013-05-15 at 10:11 +0200, Jeppi Jeppi wrote:
> I am having some issues with M.Peach's [tcpserver] object. I get some
> spureous, incorrect messages which seem to behave in a weird way
> according to the buffer size. Apparently some messages are splitted. I
> saw in http://email@example.com/msg06056.html that it
> was supposed to be a [timeout( message which would help solving this
> issue, but it seems it is no longer recognised?
> Any help welcome!
This post is from 2009 and in the meanwhile net/tcpserver probably has
changed quite a bit. I haven't checked if the 'timeout' method still
TCP is a stream-oriented protocol. It does _not_ deliver packets, but a
continuous stream of bytes. Don't expect [tcpserver] to output lists of
the exact same length as they have been sent as there is no concept of
packets in TCP. The fact that [tcpserver] does output lists and not only
single floats/bytes obfuscates this property of TCP, in my opinion (btw,
iemnet/tcpserver does only output single floats).
If your patch relies on packets, you need to implement some mechanism
for packet delimiting. One simple way is to encode your packets with
[slipenc] on the sending side and get proper packets back with [slipdec]
on the receiving side.
More information about the Pd-list