public LocalInfo() {
        try {
            localIp = Utilities.getLocalIPAddr();
            localIdentifier = Utilities.getLocalHostname() + ":" + Utilities.getRandomNumber(100000000);
            for (int i = Config.LOWER_BOUND_OF_PORT; i <= Config.UPPER_BOUND_OF_PORT; i++) {
                try {
                    socket = new DatagramSocket(i);
                    localPort = i;
                    break;
                } catch (SocketException exception) {
                }
            }
            if (socket == null)
                throw new SocketException();
        } catch (UnknownHostException e) {
            e.printStackTrace();
            System.exit(ExitCode.LOCALIP_NOT_FOUND);
        } catch (SocketException e) {
            System.out.println("All the ports have been bounded");
            System.exit(ExitCode.BINDING_SOCKET_ERROR);
        }
    }