write(byte[]) data loss
in
Core Library Questions
•
2 years ago
Hello
Using processing.network core lib, byte arrays greater than 9200 fail during transmission and arrive incomplete. Why is it happening? Does it mean byte arrays must be split in order to be sent?
Sample code:
- /** Server */
- import processing.net.*;
- Server s;
- byte[] b = new byte[9300];
- void setup() {
- s = new Server(this, 10002);
- }
- void draw() {
- s.write(b);
- }
- /** Client */
- import processing.net.*;
- Client s;
- byte[] b = new byte[9300];
- void setup() {
- s = new Client(this, "localhost", 10002);
- }
- void draw() {
- println(s.readBytes(b));
- }
1