title: Android ServerSocket accept as wifi hotspot
body: <p>I have an android device that is running as an access point (a.k.a. wifi hotspot) and It is running this code:</p>
  
  <pre><code>    serverSocket = new ServerSocket(serverPort);
  
      serverSocket.setReuseAddress(true);
  
      while (RUNNING) {
          try {
              final Socket socket = serverSocket.accept();
  </code></pre>
  
  <p>I will have some other client device connect to this device's wifi hotspot, and try to connect to the socket, and it will not be able to.</p>
  
  <p>The access point's ip address is something like 192.168.43.1 ... so I will try to connect from the client device to 192.168.43.1:8080 and it will not work.</p>
  
  <p><strong>However</strong>, if both devices are connected to another wifi network, the serverSocket.accept(); will work just fine! I am using port 8080. </p>
  
  <p>Do I need to tell the server socket to accept on the interface "ap0"? (Can I do that?)
  Is it a firewall issue on the android device? </p>
  
  <p>Any solutions/ideas/suggestions are appreciated!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I changed the port to 8988 and now it works just fine! ...
  Could it be a firewall issue?
  Any ideas how to navigate this issue?</p>