Hey Guys,
I’m using the Processing network library and want to search for possible Processing servers. How is that possible?
              
              
              1 Like
            
            
          Hello,
I had some success with this:
Minimal code to get you started < Expand this!
import java.io.*;
import java.net.*;
boolean state = false;
void setup()
  {   
  try 
    {
    InetAddress address = InetAddress.getByName("192.168.1.100");
    //System.out.println("Name: " + address.getHostName());
    //System.out.println("Addr: " + address.getHostAddress());
    state = address.isReachable(3000); 
    System.out.println("Reach: " + state);
    }
  catch (UnknownHostException e) 
    {
    System.err.println("Unable to lookup...");
    }
  catch (IOException e) 
    {
    System.err.println("Unable to reach...");
    }      
  }
You can write the rest to scan IPs.
Not so much (slow) with this:
I also had to run Processing as “administrator” to ping.
I just included as a reference.
That was fun!
I can use this in future…
:)
              
              
              1 Like
            
            
          Thank you.
But there is another question from me. Is it possible to find all servers with the same IP address (different ports) without pinging each port?
Hello,
I branched off on a tangent with my answer and it only finds reachable IP’s.
I don’t have an answer for ports at this time and would have to seek one.
Back to work and busy these days…
Keep looking!
And I am back already!
I did find this:
And so far got this and it did detect an active server port:
I got a “false” if I looked for a port “12347” that was not active.
Using the server example:

I may explore this more later…
It is my first time exploring this also.
:)
              
              
              1 Like
            
                
            
          