¿Cómo me conecto al socket del servidor utilizando la dirección IP y el número de puerto (el cliente se ejecuta en una máquina diferente que el servidor)

Programa cliente

public class client implements Runnable {

protected static String server_IP = "141.117.57.42";
private static final int server_Port = 5555 ;
protected static String client_IP ;


public static void main(String[] args) throws IOException{
    final  String host = "localhost";
    int init = 0  ;

    try {
        InetAddress iAddress = InetAddress.getLocalHost();
        client_IP = iAddress.getHostAddress();
        System.out.println("Current IP address : " +client_IP);
    } catch (UnknownHostException e) {
    }

    try {System.out.println("hello1");
        Socket socket = new Socket(server_IP,server_Port);
        System.out.println("hello3");
        init = initialize(socket);

    }catch (SocketException e) {
        System.out.println("Error: Unable to connect to server port ");
    }


    if (init ==  0 ){
        System.out.println("error: Failed to initialize ");
        System.exit(0);

    }
    //Thread init_Thread = new Thread();
}
private static int initialize(Socket socket ) throws IOException{
    System.out.println("hello");
    int rt_value = 0 ;

    OutputStream os = socket.getOutputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    PrintWriter pw = new PrintWriter(os, true);

    System.out.println("server: " + br.readLine());
    pw.println("192.343.34.321");
   // BufferedReader userInputBR = new BufferedReader(new InputStreamReader(System.in));
    //String userInput = userInputBR.readLine();

    //out.println(userInput);

    socket.close();
    return rt_value = 1 ;



}
public void run(){

}
}

programa del lado del servidor

public class server {

protected static String server_IP ;

public static void main(String[] args) throws IOException {


    int server_Port = 5555 ;



    try {
        InetAddress iAddress = InetAddress.getLocalHost();
        server_IP = iAddress.getHostAddress();
        System.out.println("Server IP address : " +server_IP);
    } catch (UnknownHostException e) {
    }

        ServerSocket serverSocket = new ServerSocket(server_Port);


        while (true) {
            Socket socket = serverSocket.accept();

             OutputStream os = socket.getOutputStream();
            PrintWriter pw = new PrintWriter(os, true);
            InputStreamReader isr = new InputStreamReader(socket.getInputStream());
            pw.println("Connection confirmed ");
            BufferedReader br = new BufferedReader(isr);
            String str = br.readLine();

            pw.println("your ip address is " + str);

            pw.close();
           //socket.close();

            //System.out.println("Just said hello to:" + str);
        }

¿Cómo me conecto al socket del servidor utilizando la dirección IP y el número de puerto (el cliente se ejecuta en una máquina diferente que el servidor) cuando cambio el server_IP en el cliente a "host local" funciona perfectamente, cualquier ayuda sería apreciada.

Respuestas a la pregunta(2)

Su respuesta a la pregunta