title: Java: what's the IP address of server in order to connect two different computers
body: <p>I've designed a small multiplayer game on java and have successfully tested it using local host ip "127.0.0.1" but now I want to test it on two different computers which are both connected to a Wifi network.  </p>
  
  <p>the problem is I don't know which ip address client need to use to connect to the server. i have used IPv4 Address (in cmd ipconfig) but they don't seem to connect.  </p>
  
  <p>Client:  </p>
  
  <pre><code>public class Client {
      Socket client;
      ObjectOutputStream oos;
      ObjectInputStream ois;
  
      public Client(String gameServer) {
          try {
              client = new Socket(InetAddress.getByName(gameServer),8888);
              oos = new ObjectOutputStream(client.getOutputStream());
              ois = new ObjectInputStream(client.getInputStream());
          } catch (IOException e) {
              e.printStackTrace();
          }
      }  
  </code></pre>
  
  <p>Server:</p>
  
  <pre><code>public class Server {
      ServerSocket ss = null;
      Socket server;
      ObjectOutputStream oos;
      ObjectInputStream ois;
  
      public Server() {
          try {
              ss = new ServerSocket(8888, 10, InetAddress.getByName("0.0.0.0"));
              server = ss.accept();
              System.out.println("-----&gt;" + server.getInetAddress().getHostName());
              System.out.println("Successful connection");
              oos = new ObjectOutputStream(server.getOutputStream());
              ois = new ObjectInputStream(server.getInputStream());
          } catch (IOException e) {
              e.printStackTrace();
          }
      }  
  </code></pre>
  
  <p>basically I don't know what to enter as the constructor of the Client class in order to connect these two computers.</p>