I need to get data from TCP, which is huge, so I need to append a lot of Raw values to big buffer. How can I achieve this?
It should work like Writer (Raw) node, but it should just keep data in memory.
I tried using Queue and then + (Spectral), but vvvv crashes on it (and not because of memory overflow issues).
I am thinking about writing new node using Template (Raw). Is there any better solution?
what’s the problem with appending to a temporary file?
May 9, 2014, 12:04pm
It works, but why do I need disk I/O when all my data fits in memory?
May 9, 2014, 12:07pm
can you patch us a demo that shows this?
then you can also try
Writer (Raw SharedMemory) that will be available with upcoming beta32. only it needs a max size set from the beginning.
Sure. Attached small example.
So what do you recommend me right now?
To write plugin using Template (Raw)?
patch with reproducible bug (793.8 kB)
May 10, 2014, 1:49am
i just tried your patch and while it crashes with b31.2 it works fine with b32.
works alright in beta32, thank you.
The fixed size is quite okay to work with, but I think the node should be doing some internal auto-padding. Right now it overwrites the shared memory only with as much bytes as are inputted and leaves the rest as it is.
One patch-around is to use
Pad (String) but I don’t think that is the smart choice for most cases involving Raw. The other is to + (Raw) with a long-enough bytestream, which is quite cryptic to read.
May 14, 2014, 1:59am
@velcrome what other benefit than having a clean memory space (which noone ever sees) would such an auto-padding have?
this is only a matter when bytestreams with changing length are sent through a fixed sized transmitter.
on the receiving end it is impossible to tell, which data is actually fresh or useful and what part is just left over from frames long gone.
padding kind of solves this by making sure, there are no left overs at all.
May 14, 2014, 12:37pm
in any case i’d argue you’d better reserve the first 1-4 bytes to encode the length of the current data and better rely on that than to look for some padding at the end.
I agree, a length index would be even better. Is this something that could be put inside the plugin?
May 14, 2014, 1:48pm
that could be a job for a module around the node then…