@Override
    protected void process_pipe_term_ack ()
    {
        //  Notify the user that all the references to the pipe should be dropped.
        assert (sink!=null);
        sink.terminated (this);

        //  In terminating and double_terminated states there's nothing to do.
        //  Simply deallocate the pipe. In terminated state we have to ack the
        //  peer before deallocating this side of the pipe. All the other states
        //  are invalid.
        if (state == State.terminated) {
            outpipe = null;
            send_pipe_term_ack (peer);
        }
        else
            assert (state == State.terminating || state == State.double_terminated);

        //  We'll deallocate the inbound pipe, the peer will deallocate the outbound
        //  pipe (which is an inbound pipe from its point of view).
        //  First, delete all the unread messages in the pipe. We have to do it by
        //  hand because msg_t doesn't have automatic destructor. Then deallocate
        //  the ypipe itself.
        while (inpipe.read () != null) {
        }
        
        inpipe = null;

        //  Deallocate the pipe object
    }