public Connection(InetSocketAddress address){
        try {
            this.selector = Selector.open();
        } catch (IOException e) {
            LOGGER.severe("Could not open Selector! " + e.getMessage());
            System.exit(1);
        }
        try {
            this.channel = SocketChannel.open(address);
            channel.configureBlocking(false);
            System.out.println("Connecting...");
            while(!channel.finishConnect());
            System.out.println("Successfully connected!");
            channel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRITE);
        } catch (IOException e) {
            LOGGER.severe("Could not initialize sockets! " + e.getMessage());
        }

        handler = new PacketHandler();

        this.thread = new Thread(this);
        this.thread.start();
    }