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); }
public void Push(IServerChannelSink sink, object state) { this._stack = new ServerChannelSinkStack.SinkStack() { PrevStack = this._stack, Sink = sink, State = state }; }
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); }
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); }
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 } } ; }
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); }