I'm trying to send messages to Arduino via serial. The messages are in binary format, ie, they are arrays of bytes (not text). If I send the values one by one with Serial.write(), it works fine, tough, every call to Serial.write() results in a latency of several milliseconds (during this latency, system is not able to process serial events, so, incoming serial data is also lost).
To avoid this latency, I try to send all the bytes together using Serial.write(bytes[]), but then I get even more problems.
Although initially it works well, after a few messages sent, messages start to come with large and random latencies, ie, several seconds after the command was executed, and then, it begin to transmit no messages at all, without any noticeable error reporting. Finally, to recover from this situation is not enough to re-run the sketch or restart Processing itself, but I have to completely disconnect and reconnect Arduino instead.
I've been trying it for several months, with different Processing and RXTX versions, and found no way to "fast" send serial data. I have no problem, however, with other environments like OpenFrameworks, under the same Windows XP 32bit.