Network classes not recognised

Hi there, i was testing oout the network library on my old computer (with an older version of processing) and the network library and associated classes (Server and Client) worked fine. I’ve just tried to run the same sketch on my newer mac and PC and both dont recognises the Client or Server Class from the same sketch. Whats going on? thanks.

//client test	

import processing.net.*; 


Client myClient; 
Serial myPort;

char val; 
String word = "";
 
void setup() { 
  size(200, 200); 
  // Connect to the local machine at port 5204.
  // This example will not run if you haven't
  // previously started a server on this port.
  myClient = new Client(this, "2a02:c7f:7058:e100:21d:4fff:feff:1747", 5204);

} 
 
void draw() { 
  background(0);
//  if (myClient.available() > 0) { 
//    val = myClient.readChar(); 
//    myPort.write(val);
//  } 
  if (myClient.available() > 0) { 
    word = myClient.readString(); 
  } 
  fill(255);
  text(word,width/2,height/2);
 
} 
1 Like

here is no problem with the integrated processing.net lib of processing 3.5.3

  • using a win7 PC ( as client ) and a Raspberry Pi ( as server )
    and a ivp4 for server.

  • you sure your network ok, and the new PC’s can reach that server?
    and the server code is running?

  • ping works?

1 Like

Hi thanks. ive not even tried connecting to the server as the Classes aren’t even recognised so the sketch wont compile…

hm, might be a install problem?
after processing 3.5.3 download / unzip / start / set new sketchbook path,
how/what you copy your old sketch source?
please show copy or snapshot your exact error msg.


if i use (ONLY, without the server running )
/ File / Examples / Libraries / Network / SharedCanvasClient
and start it i get ERROR

java.net.ConnectException: Connection refused: connect

PLEASE test exactly same example code

Its would be strange for it to be an install problem because im getting the same error on two completely different machines (mac and PC) - the error message is: "The class “Client does not exist”

if i start your above sketch code
win7 / 64bit / processing 3.5.3 64bit /
i get

Cannot find a class or type named “Serial”

if i disable that line the canvas open and after some time show ERROR:


java.net.ConnectException: Connection timed out: connect

Even with the most simple sketch, the class simply cannot be found:

import processing.net.*; 


Client myClient; 

void setup(){
 
}

void draw(){
 
}

this still gives me the same error

can you show us a snapshot of the full processing window? ( with error msg )

1 Like

hm, why you are in android MODE, try JAVA first

and why you not run 3.5.3?
if you need older versions pls. stick with the so called
STABLE RELEASES
https://processing.org/download/

2 Likes

haha, yes i have literally just realised that now, doh! Problem resolved, thanks for your help!

1 Like