@Override
    protected void execute() {
        try {
            for(int i; (i = in.read()) != -1;) {
                char c = (char) i;
                robot.log.printf(TRACE, "received '%s'", c);
                
                if(c == ACTIVE) robot.setCharging(false);
                else if(c == INACTIVE) robot.setCharging(true);
            }
        } catch(Exception ex) {
            robot.log.printf(WARNING, "disconnected (%s)", ex);
        } finally {
            robot.setCharging(true);
            robot.client = null;
            try {
                out.close();
            } catch(Exception e) {}
            try {
                in.close();
            } catch(Exception e) {}
            try {
                sock.close();
            } catch(Exception e) {}
        }
    }