using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
namespace System.Runtime.Remoting.Channels
{
/// Holds the stack of server channel sinks.
// Token: 0x020003B2 RID: 946
[ComVisible(true)]
public class ServerChannelSinkStack : IServerChannelSinkStack, IServerResponseChannelSinkStack
{
/// Returns the onto which the specified message is to be serialized.
/// The onto which the specified message is to be serialized.
/// The message to be serialized onto the requested stream.
/// The headers retrieved from the server response stream.
/// The sink stack is empty.
///
///
///
// Token: 0x060025CD RID: 9677 RVA: 0x0007CD64 File Offset: 0x0007AF64
public Stream GetResponseStream(IMessage msg, ITransportHeaders headers)
{
if (this._sinkStack == null)
{
throw new RemotingException("The sink stack is empty");
}
return ((IServerChannelSink)this._sinkStack.Sink).GetResponseStream(this, this._sinkStack.State, msg, headers);
}
/// Pops the information associated with all the sinks from the sink stack up to and including the specified sink.
/// Information generated on the request side and associated with the specified sink.
/// The sink to remove and return from the sink stack.
/// The current sink stack is empty, or the specified sink was never pushed onto the current stack.
///
///
///
// Token: 0x060025CE RID: 9678 RVA: 0x0007CDA0 File Offset: 0x0007AFA0
public object Pop(IServerChannelSink sink)
{
while (this._sinkStack != null)
{
ChanelSinkStackEntry sinkStack = this._sinkStack;
this._sinkStack = this._sinkStack.Next;
if (sinkStack.Sink == sink)
{
return sinkStack.State;
}
}
throw new RemotingException("The current sink stack is empty, or the specified sink was never pushed onto the current stack");
}
/// Pushes the specified sink and information associated with it onto the sink stack.
/// The sink to push onto the sink stack.
/// Information generated on the request side that is needed on the response side.
///
///
///
// Token: 0x060025CF RID: 9679 RVA: 0x0007CDF4 File Offset: 0x0007AFF4
public void Push(IServerChannelSink sink, object state)
{
this._sinkStack = new ChanelSinkStackEntry(sink, state, this._sinkStack);
}
/// Provides a delegate to handle a callback after a message has been dispatched asynchronously.
/// The status and state of an asynchronous operation on a remote object.
///
///
///
///
// Token: 0x060025D0 RID: 9680 RVA: 0x0007CE0C File Offset: 0x0007B00C
[MonoTODO]
public void ServerCallback(IAsyncResult ar)
{
throw new NotImplementedException();
}
/// Stores a message sink and its associated state for later asynchronous processing.
/// A server channel sink.
/// The state associated with .
/// The current sink stack is empty.-or-The specified sink was never pushed onto the current stack.
///
///
///
// Token: 0x060025D1 RID: 9681 RVA: 0x0007CE14 File Offset: 0x0007B014
[MonoTODO]
public void Store(IServerChannelSink sink, object state)
{
throw new NotImplementedException();
}
/// Stores a message sink and its associated state, and then dispatches a message asynchronously, using the sink just stored and any other stored sinks.
/// A server channel sink.
/// The state associated with .
///
///
///
// Token: 0x060025D2 RID: 9682 RVA: 0x0007CE1C File Offset: 0x0007B01C
[MonoTODO]
public void StoreAndDispatch(IServerChannelSink sink, object state)
{
throw new NotImplementedException();
}
/// Requests asynchronous processing of a method call on the sinks in the current sink stack.
/// The message to be serialized onto the requested stream.
/// The headers retrieved from the server response stream.
/// The stream coming back from the transport sink.
/// The current sink stack is empty.
///
///
///
// Token: 0x060025D3 RID: 9683 RVA: 0x0007CE24 File Offset: 0x0007B024
public void AsyncProcessResponse(IMessage msg, ITransportHeaders headers, Stream stream)
{
if (this._sinkStack == null)
{
throw new RemotingException("The current sink stack is empty");
}
ChanelSinkStackEntry sinkStack = this._sinkStack;
this._sinkStack = this._sinkStack.Next;
((IServerChannelSink)sinkStack.Sink).AsyncProcessResponse(this, sinkStack.State, msg, headers, stream);
}
// Token: 0x04000EC2 RID: 3778
private ChanelSinkStackEntry _sinkStack;
}
}