public RoutingClient(String localIp, String adyacentNode, String name){
        adyacentIp = adyacentNode;
        try {
            System.out.println("Starting a new client");
            InetAddress address = InetAddress.getByName(adyacentIp);
            //socket = new Socket(address, ROUTING_CLIENT_PORT);
            socket = new Socket();
            socket.connect(new InetSocketAddress(address, ROUTING_CLIENT_PORT), 10000);
            OUT = new PrintWriter(socket.getOutputStream());
            IN = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            LOCAL_IP = localIp;
            successfulConnection = true;
            threadName = name;
        }catch(IOException ioe){
            System.err.println("Error while try to create the new connection with the host: " + adyacentIp
                    +"\ngive the following error: " + ioe);
            successfulConnection = false;
        }catch(SecurityException se){
            System.err.println("A security method don´t allow the connection: " + se);
            successfulConnection = false;
        }catch(IllegalArgumentException iae){
            System.err.println("Error, the port inserted don´t exist: " + iae);
            successfulConnection = false;
        }catch(NullPointerException npe){
            System.err.println("Error, the given host is empty: " + npe);
            successfulConnection = false;
        }
    }