简体   繁体   中英

How to receive big OSC blob in Java

I am trying to receive quite big OSC blob (array of more than 10000 bytes) from PureData with Java.

I tried oscP5 library and I got ArrayIndexOutOfBoundsException above around 1500 bytes.

I have the same with JavaOSC library with the same limitation (with code example from https://wush.net/trac/lsu-idt/wiki/JavaOSC ).

NetUtil [3] lib give me de.sciss.net.OSCException: Error while receiving OSC packet: java.nio.BufferUnderflowException

However I can easily receive those blob and even bigger one with PureData. So I guess something is wrong with my Java configuration.

I tried to increase the VM memory with -Xms512m and even -Xms2048m, but this doesn't help.

The oscP5 library has a default datagram size of 1536, which is why you experienced that bound. You can change the datagram size with OSCProperties::setDatagramSize(), which is used in the constructor of the OscP5 object:

OscP5(Object theParent, OscProperties theProperties)

See this link for an old example from the Processing forum:

https://forum.processing.org/one/topic/query-re-sending-large-number-of-values-to-processing-via-osc-from-supercollider.html

Clay Budin NYC

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM