public IServerChannelSink CreateSink(IChannelReceiver channel)
        {
            if (null == channel)
            {
                throw new ArgumentNullException("channel");
            }

            IServerChannelSink nextSink = null;

            if (_next != null)
            {
                nextSink = _next.CreateSink(channel);
            }

            BinaryServerFormatterSink.Protocol protocol =
                BinaryServerFormatterSink.Protocol.Other;

            // see if this is an http channel
            String uri = channel.GetUrlsForUri("")[0];

            if (String.Compare("http", 0, uri, 0, 4, StringComparison.OrdinalIgnoreCase) == 0)
            {
                protocol = BinaryServerFormatterSink.Protocol.Http;
            }

            BinaryServerFormatterSink sink = new BinaryServerFormatterSink(protocol, nextSink, channel);

            sink.TypeFilterLevel   = _formatterSecurityLevel;
            sink.IncludeVersioning = _includeVersioning;
            sink.StrictBinding     = _strictBinding;
            return(sink);
        } // CreateSink
Ejemplo n.º 2
0
 public BinaryServerFormatterSink(BinaryServerFormatterSink.Protocol protocol,
                                  IServerChannelSink nextSink,
                                  IChannelReceiver receiver)
 {
     this.protocol  = protocol;
     this.next_sink = nextSink;
     this.receiver  = receiver;
 }
        public IServerChannelSink CreateSink(IChannelReceiver channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }
            IServerChannelSink nextSink = null;

            if (this._next != null)
            {
                nextSink = this._next.CreateSink(channel);
            }
            BinaryServerFormatterSink.Protocol other = BinaryServerFormatterSink.Protocol.Other;
            string strB = channel.GetUrlsForUri("")[0];

            if (string.Compare("http", 0, strB, 0, 4, StringComparison.OrdinalIgnoreCase) == 0)
            {
                other = BinaryServerFormatterSink.Protocol.Http;
            }
            return(new BinaryServerFormatterSink(other, nextSink, channel)
            {
                TypeFilterLevel = this._formatterSecurityLevel, IncludeVersioning = this._includeVersioning, StrictBinding = this._strictBinding
            });
        }