Receive Jitter matrices in Processing

346 Views Asked by At

I'm trying to send video from Max/Jitter using [jit.net.send] to a Processing sketch. The sketch is then supposed to redraw the image on screen. However I can't seem to receive anything sent with [jit.net.send] in Processing.

On the Jitter side the IP is 127.0.0.1, port 7474 (which are also the defaults. I can receive them using [jit.net.recv]). This is the Processing sketch:

import processing.net.*; 
Client myClient;

void setup() {
  size(200, 200);
  myClient = new Client(this, "127.0.0.1", 7474);
}

void draw() {
  if (myClient.available() > 0) {
    println(myClient.read());
  }
}

When I run the sketch, Processing says:

java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at processing.net.Client.<init>(Client.java:77)
    at sketch_140123a.setup(sketch_140123a.java:24)
    at processing.core.PApplet.handleDraw(PApplet.java:2241)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
    at processing.core.PApplet.run(PApplet.java:2140)
    at java.lang.Thread.run(Thread.java:662)

Is processing.net.Client not suitable for this? I'm on Windows 7 32bit and the firewall is off.

1

There are 1 best solutions below

0
On BEST ANSWER

I solved it in the end in a hackish way. I saved a continuous stream of bitmap images from Jitter to the disk on a location accessible through a web server running on the same machine as jitter was running. On the Processing side I made individual requests for those images. I can provide the code if anyone reading this is interested.