예제 #1
0
 public void Store(IServerChannelSink sink, object state)
 {
     if (this._stack == null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Channel_StoreOnEmptySinkStack"));
     }
     while (this._stack.Sink != sink)
     {
         this._stack = this._stack.PrevStack;
         if (this._stack == null)
         {
             break;
         }
     }
     if (this._stack.Sink == null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Channel_StoreOnSinkStackWithoutPush"));
     }
     this._rememberedStack = new ServerChannelSinkStack.SinkStack()
     {
         PrevStack = this._rememberedStack,
         Sink      = sink,
         State     = state
     };
     this.Pop(sink);
 }
예제 #2
0
 public void Push(IServerChannelSink sink, object state)
 {
     this._stack = new ServerChannelSinkStack.SinkStack()
     {
         PrevStack = this._stack,
         Sink      = sink,
         State     = state
     };
 }
예제 #3
0
        public Stream GetResponseStream(IMessage msg, ITransportHeaders headers)
        {
            if (this._stack == null)
            {
                throw new RemotingException(Environment.GetResourceString("Remoting_Channel_CantCallGetResponseStreamWhenStackEmpty"));
            }
            IServerChannelSink sink  = this._stack.Sink;
            object             state = this._stack.State;

            this._stack = this._stack.PrevStack;
            Stream responseStream = sink.GetResponseStream((IServerResponseChannelSinkStack)this, state, msg, headers);

            this.Push(sink, state);
            return(responseStream);
        }
예제 #4
0
        public void AsyncProcessResponse(IMessage msg, ITransportHeaders headers, Stream stream)
        {
            if (this._stack == null)
            {
                throw new RemotingException(Environment.GetResourceString("Remoting_Channel_CantCallAPRWhenStackEmpty"));
            }
            IServerChannelSink serverChannelSink = this._stack.Sink;
            object             obj = this._stack.State;

            this._stack = this._stack.PrevStack;
            object            state    = obj;
            IMessage          msg1     = msg;
            ITransportHeaders headers1 = headers;
            Stream            stream1  = stream;

            serverChannelSink.AsyncProcessResponse((IServerResponseChannelSinkStack)this, state, msg1, headers1, stream1);
        }
예제 #5
0
 private void FlipRememberedStack()
 {
     if (this._stack != null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Channel_CantCallFRSWhenStackEmtpy"));
     }
     for (; this._rememberedStack != null; this._rememberedStack = this._rememberedStack.PrevStack)
     {
         this._stack = new ServerChannelSinkStack.SinkStack()
         {
             PrevStack = this._stack,
             Sink      = this._rememberedStack.Sink,
             State     = this._rememberedStack.State
         }
     }
     ;
 }
예제 #6
0
        public object Pop(IServerChannelSink sink)
        {
            if (this._stack == null)
            {
                throw new RemotingException(Environment.GetResourceString("Remoting_Channel_PopOnEmptySinkStack"));
            }
            while (this._stack.Sink != sink)
            {
                this._stack = this._stack.PrevStack;
                if (this._stack == null)
                {
                    break;
                }
            }
            if (this._stack.Sink == null)
            {
                throw new RemotingException(Environment.GetResourceString("Remoting_Channel_PopFromSinkStackWithoutPush"));
            }
            object obj = this._stack.State;

            this._stack = this._stack.PrevStack;
            return(obj);
        }