public boolean check_read() {
        if (!in_active || (state != State.active && state != State.pending))
            return false;

        //  Check if there's an item in the pipe.
        if (!inpipe.check_read ()) {
            in_active = false;
            return false;
        }

        //  If the next item in the pipe is message delimiter,
        //  initiate termination process.
        if (is_delimiter(inpipe.probe ())) {
            Msg msg = inpipe.read ();
            assert (msg != null);
            delimit ();
            return false;
        }

        return true;
    }