public TextWebSocketWrapperConnection(IWebSocketWrapper webSocket, IWampTextBinding <TMessage> binding,
                                       ICookieProvider cookieProvider,
                                       ICookieAuthenticatorFactory cookieAuthenticatorFactory, int?maxFrameSize) :
     base(webSocket, binding, cookieProvider, cookieAuthenticatorFactory, maxFrameSize)
 {
     mBinding = binding;
 }
Esempio n. 2
0
 public TextConnectionListener
     (IWampTextBinding <TMessage> binding,
     TextBinaryTransport <TConnection> parent) :
     base(parent)
 {
     Binding = binding;
 }
Esempio n. 3
0
 public VtortolaWampTextConnection(WebSocket connection,
                                   IWampTextBinding <TMessage> binding,
                                   ICookieAuthenticatorFactory cookieAuthenticatorFactory) :
     base(connection, cookieAuthenticatorFactory)
 {
     mBinding = binding;
 }
Esempio n. 4
0
 public WampAuthenticationTextBinding(IWampTextBinding <TMessage> binding,
                                      IWampSessionAuthenticatorFactory sessionAuthenticationFactory,
                                      IWampUriValidator uriValidator)
     : base(binding, sessionAuthenticationFactory, uriValidator)
 {
     mBinding = binding;
 }
Esempio n. 5
0
        private IWampConnectionListener <TMessage> GetListener <TMessage>(IWampTextBinding <TMessage> binding)
        {
            TextConnectionListener <TMessage> listener = new TextConnectionListener <TMessage>(binding, this);

            RegisterBinding(binding, listener);

            return(listener);
        }
Esempio n. 6
0
 public FleckWampConnectionListener(string location,
                                    IWampTextBinding <TMessage> binding,
                                    X509Certificate2 certificate = null)
 {
     mLocation    = location;
     mBinding     = binding;
     mCertificate = certificate;
 }
 public FleckWampTextConnection(IWebSocketConnection webSocketConnection,
                                IWampTextBinding <TMessage> binding,
                                ICookieAuthenticatorFactory cookieAuthenticatorFactory = null)
     : base(webSocketConnection, cookieAuthenticatorFactory)
 {
     mBinding = binding;
     webSocketConnection.OnMessage = OnConnectionMessage;
 }
Esempio n. 8
0
 public SignalRTextConnection(IConnection connection, string connectionId,
                              SignalRConnectionListenerAdapter <TMessage> parent)
 {
     mConnection   = connection;
     mConnectionId = connectionId;
     mBinding      = parent.mBinding;
     mParent       = parent;
 }
        /// <summary>
        /// Creates a <see cref="IWampChannel"/> that connects to a given realm,
        /// using the given address and the given text binding
        /// </summary>
        /// <param name="address">The given address.</param>
        /// <param name="realm">The given realm to connect to.</param>
        /// <param name="binding">The given text binding.</param>
        /// <returns></returns>
        public IWampChannel CreateChannel <TMessage>(string address,
                                                     string realm,
                                                     IWampTextBinding <TMessage> binding)
        {
            Func <IControlledWampConnection <TMessage> > connectionFactory =
                () => new WebSocket4NetTextConnection <TMessage>(address, binding);

            return(this.CreateChannel(realm, connectionFactory, binding));
        }
        /// <summary>
        /// Creates a <see cref="IWampChannel"/> that connects to a given realm,
        /// using the given address and the given text binding
        /// </summary>
        /// <param name="address">The given address.</param>
        /// <param name="realm">The given realm to connect to.</param>
        /// <param name="binding">The given text binding.</param>
        /// <returns></returns>
        public IWampChannel CreateChannel <TMessage>(string address,
                                                     string realm,
                                                     IWampTextBinding <TMessage> binding)
        {
            var connection =
                new MessageWebSocketTextConnection <TMessage>(address, binding);

            return(this.CreateChannel(realm, connection, binding));
        }
 /// <exclude />
 protected override IWampConnection <TMessage> CreateTextConnection <TMessage>
     (WebSocketData connection,
     IWampTextBinding <TMessage> binding)
 {
     return(new TextWebSocketConnection <TMessage>(connection.WebSocket,
                                                   binding,
                                                   new AspNetCookieProvider(connection.HttpContext),
                                                   AuthenticatorFactory));
 }
 public FleckWampConnectionListener(string location,
                                    IWampTextBinding <TMessage> binding,
                                    X509Certificate2 certificate,
                                    Func <SslProtocols> getEnabledSslProtocols)
 {
     mLocation               = location;
     mBinding                = binding;
     mCertificate            = certificate;
     mGetEnabledSslProtocols = getEnabledSslProtocols;
 }
        /// <summary>
        /// Creates a <see cref="IWampChannel"/> that connects to a given realm,
        /// using the given address and the given text binding
        /// </summary>
        /// <param name="address">The given address.</param>
        /// <param name="realm">The given realm to connect to.</param>
        /// <param name="binding">The given text binding.</param>
        /// <param name="authenticator">The authenticator object to handle CHALLENGE request.</param>
        /// <returns></returns>
        public IWampChannel CreateChannel <TMessage>(string address,
                                                     string realm,
                                                     IWampTextBinding <TMessage> binding,
                                                     IWampClientAuthenticator authenticator)
        {
            Func <IControlledWampConnection <TMessage> > connectionFactory =
                () => new ControlledTextWebSocketConnection <TMessage>(new Uri(address), binding, null);

            return(this.CreateChannel(realm, connectionFactory, binding, authenticator));
        }
        /// <summary>
        /// Creates a new instance of <see cref="SignalRTextConnection{TMessage}"/>.
        /// </summary>
        /// <param name="uri">The uri of the server to connect to.</param>
        /// <param name="binding">The binding to use.</param>
        /// <param name="transport">The <see cref="IClientTransport"/> to use.</param>
        public SignalRTextConnection(string uri, IWampTextBinding <TMessage> binding, IClientTransport transport)
        {
            mBinding    = binding;
            mTransport  = transport;
            mConnection = new Connection(uri);

            mConnection.Closed   += OnClosed;
            mConnection.Error    += OnError;
            mConnection.Received += OnReceived;
        }
Esempio n. 15
0
 /// <exclude />
 protected override IWampConnection <TMessage> CreateTextConnection <TMessage>
     (WebSocketData connection,
     IWampTextBinding <TMessage> binding)
 {
     return(new TextWebSocketConnection <TMessage>(connection.Context.WebSocket,
                                                   binding,
                                                   new HttpListenerCookieProvider(connection.Context),
                                                   AuthenticatorFactory,
                                                   mMaxFrameSize));
 }
Esempio n. 16
0
        private IControlledWampConnection <TMessage> GetConnectionFactory <TMessage>(IWampBinding <TMessage> binding)
        {
            IWampTextBinding <TMessage> textBinding = binding as IWampTextBinding <TMessage>;

            if (textBinding != null)
            {
                return(CreateTextConnection(textBinding));
            }

            throw new Exception();
        }
Esempio n. 17
0
        private WebSocket ActivateWebSocket <TMessage>(IWampTextBinding <TMessage> textBinding)
        {
            WebSocket webSocket = mWebSocketFactory(textBinding.Name);

            if (SecurityOptionsConfigureAction != null)
            {
                SecurityOptionsConfigureAction(webSocket.Security);
            }

            return(webSocket);
        }
Esempio n. 18
0
        protected override IWampConnection <TMessage> CreateTextConnection <TMessage>
            (WebSocketData connection,
            IWampTextBinding <TMessage> binding)
        {
            ConfigureComputeBytes(binding);

            return(new TextWebSocketConnection <TMessage>
                       (connection.WebSocket,
                       binding,
                       new AspNetCoreCookieProvider(connection.HttpContext),
                       AuthenticatorFactory,
                       mMaxFrameSize));
        }
Esempio n. 19
0
 private IWampConnectionListener <TMessage> GetListener <TMessage>(IWampTextBinding <TMessage> binding)
 {
     if (mListener != null)
     {
         throw new ArgumentException("Listener already set.");
     }
     else
     {
         SignalRConnectionListener <TMessage> result = new SignalRConnectionListener <TMessage>(mUrl, binding, mEnableCORS, mEnableJSONP, mPathMatch);
         mListener = result;
         return(result);
     }
 }
Esempio n. 20
0
        public IWampConnectionListener <TMessage> GetListener <TMessage>(IWampBinding <TMessage> binding)
        {
            IWampTextBinding <TMessage> textBinding = binding as IWampTextBinding <TMessage>;

            if (textBinding == null)
            {
                throw new ArgumentException("This transport supports only text binding.", "binding");
            }
            else
            {
                return(GetListener(textBinding));
            }
        }
Esempio n. 21
0
        public IWampConnectionListener <TMessage> GetListener <TMessage>(IWampBinding <TMessage> binding)
        {
            IWampTextBinding <TMessage> textBinding = binding as IWampTextBinding <TMessage>;

            if (textBinding != null)
            {
                return(GetListener(textBinding));
            }

            IWampBinaryBinding <TMessage> binaryBinding = binding as IWampBinaryBinding <TMessage>;

            if (binaryBinding != null)
            {
                return(GetListener(binaryBinding));
            }

            throw new ArgumentException("WebSockets can only deal with binary/text transports", "binding");
        }
Esempio n. 22
0
 protected TextWebSocketWrapperConnection(IClientWebSocketWrapper clientWebSocket, Uri addressUri, IWampTextBinding <TMessage> binding) :
     base(clientWebSocket, addressUri, binding.Name, binding)
 {
     mBinding = binding;
 }