本文整理汇总了C#中System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties类的典型用法代码示例。如果您正苦于以下问题:C# BaseChannelObjectWithProperties类的具体用法?C# BaseChannelObjectWithProperties怎么用?C# BaseChannelObjectWithProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseChannelObjectWithProperties类属于System.Runtime.Remoting.Channels命名空间,在下文中一共展示了BaseChannelObjectWithProperties类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoggingServerChannelSinkProvider
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class LoggingServerChannelSinkProvider : IServerChannelSinkProvider
{
private IServerChannelSinkProvider next2 = null;
public LoggingServerChannelSinkProvider(IDictionary properties, ICollection providerData)
{
}
public void GetChannelData(IChannelDataStore channelData)
{
}
public IServerChannelSink CreateSink(IChannelReceiver channel1)
{
IServerChannelSink localNextSink = null;
if (next2 != null)
localNextSink = next2.CreateSink(channel1);
return new LoggingServerChannelSink(localNextSink);
}
public IServerChannelSinkProvider Next
{
get
{
return next2;
}
set
{
next2 = value;
}
}
}
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
internal class LoggingServerChannelSink : BaseChannelObjectWithProperties, IServerChannelSink
{
private IServerChannelSink nextSink2 = null;
private bool bEnabled2 = true;
public LoggingServerChannelSink(IServerChannelSink localNextSink) : base()
{
nextSink2 = localNextSink;
}
public ServerProcessing ProcessMessage( IServerChannelSinkStack sinkStack,
IMessage requestMsg,
ITransportHeaders requestHeaders,
Stream requestStream,
out IMessage responseMsg,
out ITransportHeaders responseHeaders,
out Stream responseStream
)
{
if (bEnabled2)
{
Console.WriteLine("----------Request Headers-----------");
Console.WriteLine( CommonTransportKeys.IPAddress + ":" +
requestHeaders[CommonTransportKeys.IPAddress]);
Console.WriteLine( CommonTransportKeys.ConnectionId + ":" +
requestHeaders[CommonTransportKeys.ConnectionId]);
Console.WriteLine( CommonTransportKeys.RequestUri + ":" +
requestHeaders[CommonTransportKeys.RequestUri]);
}
sinkStack.Push(this, null);
ServerProcessing processing =
nextSink2.ProcessMessage(sinkStack, requestMsg, requestHeaders, requestStream, out responseMsg,
out responseHeaders, out responseStream);
switch (processing)
{
case ServerProcessing.Complete :
{
sinkStack.Pop(this);
break;
}
case ServerProcessing.OneWay:
{
sinkStack.Pop(this);
break;
}
case ServerProcessing.Async:
{
sinkStack.Store(this, null);
break;
}
}
return processing;
}
public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state,
IMessage msg, ITransportHeaders headers, Stream stream1)
{
sinkStack.AsyncProcessResponse(msg, headers, stream1);
}
public Stream GetResponseStream(IServerResponseChannelSinkStack sinkStack, Object state,
IMessage msg, ITransportHeaders headers)
{
return null;
}
public IServerChannelSink NextChannelSink
{
get
{
return nextSink2;
}
}
}