@Override
    protected Void doInBackground() throws Exception {
        final int BUFFER_SIZE = 64000;
        Client client = new Client(BUFFER_SIZE, BUFFER_SIZE);

        client.getKryo().register(PacketLogin.class);
        client.getKryo().register(PacketLoginResponse.class);
        client.getKryo().register(PacketRequestCaptcha.class);
        client.getKryo().register(PacketCaptchaImage.class);
        client.getKryo().register(byte[].class);
        client.getKryo().register(PacketRegister.class);
        client.getKryo().register(PacketRegistered.class);
        client.getKryo().register(PacketFilesListRequest.class);
        client.getKryo().register(PacketFilesList.class);
        client.getKryo().register(String[].class);
        client.getKryo().register(PacketChangePassword.class);
        client.getKryo().register(PacketChangePasswordResponse.class);
        client.getKryo().register(PacketWLRequestRealm.class);
        client.getKryo().register(PacketWLData.class);
        client.getKryo().register(PacketAddItemToWL.class);
        client.getKryo().register(PacketBadWLItems.class);


        client.addListener(new Listener() {
            @Override
            public void received(Connection connection, Object object) {
                if (object instanceof PacketWLRequestRealm) {
                    PacketWLRequestRealm p = (PacketWLRequestRealm) object;
                    
                    doCheckStep(connection, p.realm);
                } else if (object instanceof PacketBadWLItems) {
                    publish(new WLCheckState((PacketBadWLItems) object));
                    
                    connection.close();
                }
            }
        });

        client.start();

        try {
            client.connect(5000, Constants.SERVER_HOST, Constants.SERVER_PORT);
        } catch (Exception e) {
            e.printStackTrace();

            return null;
        }

        PacketWLRequestRealm pwlrr = new PacketWLRequestRealm();
        pwlrr.username = this.username;
        pwlrr.session = this.session;
        
        client.sendTCP(pwlrr);

        return null;
    }