title: Get All Devices on WiFi Network with Java
body: <p>I am attempting to discover all of the devices on the WiFi network to which my device is connected. This is plain Java, not Android. I need to search through each device to see if it has a particular port open. I will connect to the first device I find that matches this criteria through a <code>Socket</code>, so I'll need its IP address. I am essentially attempting to write the following code:</p>
  
  <pre><code>for (WiFiDevice device : WiFi.getConnectedDevices()) {
      if (device.hasPortOpen(1234)) {
          this.socket = new Socket(device.getIPAddress(), 1234);
      }
  }
  </code></pre>