public WebSocketDuplexChannelListener(WebSocketTransportBindingElement bindingElement, BindingContext context)
            : base(context.Binding)
        {
            // populate members from binding element
            this.bufferManager = BufferManager.CreateBufferManager(WebSocketTransportBindingElement.MaxBufferSize * 10,
                                                                   WebSocketTransportBindingElement.MaxBufferSize);

            //Collection<MessageEncodingBindingElement> messageEncoderBindingElements
            //    = context.BindingParameters.FindAll<MessageEncodingBindingElement>();

            //if (messageEncoderBindingElements.Count > 1)
            //{
            //    throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
            //}
            //else if (messageEncoderBindingElements.Count == 1)
            //{
            //    this.encoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory();
            //}
            //else
            //{
            this.encoderFactory = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8).CreateMessageEncoderFactory();
            //BinaryMessageEncodingBindingElement encodingBindingElement = new BinaryMessageEncodingBindingElement();
            //encodingBindingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;
            //this.encoderFactory = encodingBindingElement.CreateMessageEncoderFactory();
            //}

            this.uri = new Uri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
        }
Exemplo n.º 2
0
        public WebSocketDuplexChannelFactory(WebSocketTransportBindingElement bindingElement, BindingContext context)
            : base(context.Binding)
        {
            // populate members from binding element
            this.bufferManager = BufferManager.CreateBufferManager(WebSocketTransportBindingElement.MaxBufferSize * 10,
                                                                   WebSocketTransportBindingElement.MaxBufferSize);

            //Collection<MessageEncodingBindingElement> messageEncoderBindingElements
            //    = context.BindingParameters.FindAll<MessageEncodingBindingElement>();

            //if (messageEncoderBindingElements.Count > 1)
            //{
            //    throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
            //}
            //else if (messageEncoderBindingElements.Count == 1)
            //{
            //    this.encoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory();
            //}
            //else
            //{
            this.encoderFactory = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8).CreateMessageEncoderFactory();
            //BinaryMessageEncodingBindingElement encodingBindingElement = new BinaryMessageEncodingBindingElement();
            //encodingBindingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;
            //this.encoderFactory = encodingBindingElement.CreateMessageEncoderFactory();
            //}

            this.useProxy          = bindingElement.UseProxy;
            this.proxyUri          = string.IsNullOrEmpty(bindingElement.ProxyUri) ? null : new Uri(bindingElement.ProxyUri);
            this.proxyAuthUserName = bindingElement.ProxyAuthUserName;
            this.proxyAuthPassword = bindingElement.ProxyAuthPassword;
        }
 public WebSocketTransportBindingElement(WebSocketTransportBindingElement elementToBeCloned)
     : base(elementToBeCloned)
 {
     this.UseProxy          = elementToBeCloned.UseProxy;
     this.ProxyUri          = elementToBeCloned.ProxyUri;
     this.ProxyAuthUserName = elementToBeCloned.ProxyAuthUserName;
     this.ProxyAuthPassword = elementToBeCloned.ProxyAuthPassword;
 }
Exemplo n.º 4
0
 public WebSocketBinding()
 {
     this.messageElement   = new TextMessageEncodingBindingElement();
     this.transportElement = new WebSocketTransportBindingElement();
 }