# Scan for servers

**URL:** https://discourse.processing.org/t/scan-for-servers/21814
**Category:** Libraries
**Created:** [June 12, 2020, 6:05pm UTC](https://discourse.processing.org/t/scan-for-servers/21814 "2020-06-12T18:05:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Moritz](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Moritz](https://discourse.processing.org/u/Moritz)
#### Post date: [June 12, 2020, 6:05pm UTC](https://discourse.processing.org/t/scan-for-servers/21814/1 "2020-06-12T18:05:00Z")

</div>

Hey Guys,  
I’m using the Processing network library and want to search for possible Processing servers. How is that possible?

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [June 12, 2020, 8:58pm UTC](https://discourse.processing.org/t/scan-for-servers/21814/2 "2020-06-12T20:58:11Z")

</div>

Hello,

I had some success with this:

> **[Real's How-to](https://www.rgagnon.com/javadetails/java-0093.html)**
>
> Real's HowTo : Useful code snippets for Java, JS, PB and more

> **Minimal code to get you started \< Expand this!**
>
> ```auto
> 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:

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/6103/check-internet-connection)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

  
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…

`:)`

---

<div class="post-metadata">

### Author: ![Moritz](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Moritz](https://discourse.processing.org/u/Moritz)
#### Post date: [June 12, 2020, 9:28pm UTC](https://discourse.processing.org/t/scan-for-servers/21814/3 "2020-06-12T21:28:00Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [June 12, 2020, 10:11pm UTC](https://discourse.processing.org/t/scan-for-servers/21814/4 "2020-06-12T22:11:27Z")

</div>

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:

> <https://stackoverflow.com/questions/11547082/fastest-way-to-scan-ports-with-java>

And so far got this and it did detect an active server port:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0e2b1eae6d02fb39ea324b1ebdf4e7c01f8966f6.png)  
I got a “false” if I looked for a port “12347” that was not active.

Using the server example:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6279cc213ab718687ffca1d2126000f830ae2dbb.png)

I may explore this more later…  
It is my first time exploring this also.

`:)`
