예제 #1
0
 public BinaryConnectionListener
     (IWampBinaryBinding <TMessage> binding,
     TextBinaryTransport <TConnection> parent)
     : base(parent)
 {
     Binding = binding;
 }
예제 #2
0
 public WampAuthenticationBinaryBinding(IWampBinaryBinding <TMessage> binding,
                                        IWampSessionAuthenticatorFactory sessionAuthenticationFactory,
                                        IWampUriValidator uriValidator)
     : base(binding, sessionAuthenticationFactory, uriValidator)
 {
     mBinding = binding;
 }
예제 #3
0
 public VtortolaWampBinaryConnection(WebSocket connection,
                                     IWampBinaryBinding <TMessage> binding,
                                     ICookieAuthenticatorFactory cookieAuthenticatorFactory) :
     base(connection, cookieAuthenticatorFactory)
 {
     mBinding = binding;
 }
예제 #4
0
 public BinaryNetMQConnection(IWampBinaryBinding <TMessage> binding, NetMQSocket socket, NetMQScheduler scheduler)
 {
     _binding              = binding;
     _socket               = socket;
     _scheduler            = scheduler;
     _socket.ReceiveReady += OnReceiveMessage;
 }
예제 #5
0
        private IWampConnectionListener <TMessage> GetListener <TMessage>(IWampBinaryBinding <TMessage> binding)
        {
            BinaryConnectionListener <TMessage> listener = new BinaryConnectionListener <TMessage>(binding, this);

            RegisterBinding(binding, listener);

            return(listener);
        }
예제 #6
0
 protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>
     (WebSocketData connection, IWampBinaryBinding <TMessage> binding)
 {
     return(new VtortolaWampBinaryConnection <TMessage>(connection.WebSocket,
                                                        connection.CancellationToken,
                                                        binding,
                                                        AuthenticatorFactory));
 }
 public BinaryWebSocketWrapperConnection(IWebSocketWrapper webSocket, IWampBinaryBinding <TMessage> binding,
                                         ICookieProvider cookieProvider,
                                         ICookieAuthenticatorFactory cookieAuthenticatorFactory,
                                         int?maxFrameSize) :
     base(webSocket, binding, cookieProvider, cookieAuthenticatorFactory, maxFrameSize)
 {
     mBinding = binding;
 }
예제 #8
0
 public FleckWampBinaryConnection(IWebSocketConnection webSocketConnection,
                                  IWampBinaryBinding <TMessage> binding,
                                  ICookieAuthenticatorFactory cookieAuthenticatorFactory) :
     base(webSocketConnection,
          cookieAuthenticatorFactory)
 {
     mBinding = binding;
     webSocketConnection.OnBinary = OnConnectionMessage;
 }
        /// <summary>
        /// Creates a <see cref="IWampChannel"/> that connects to a given realm,
        /// using the given address and the given binary binding
        /// </summary>
        /// <param name="address">The given address.</param>
        /// <param name="realm">The given realm to connect to.</param>
        /// <param name="binding">The given binary binding.</param>
        /// <returns></returns>
        public IWampChannel CreateChannel <TMessage>(string address,
                                                     string realm,
                                                     IWampBinaryBinding <TMessage> binding)
        {
            Func <IControlledWampConnection <TMessage> > connectionFactory =
                () => new WebSocket4NetBinaryConnection <TMessage>(address, binding);

            return(this.CreateChannel(realm, connectionFactory, binding));
        }
 /// <exclude />
 protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>
     (WebSocketData connection,
     IWampBinaryBinding <TMessage>
     binding)
 {
     return(new BinaryWebSocketConnection <TMessage>(connection.WebSocket,
                                                     binding,
                                                     new AspNetCookieProvider(connection.HttpContext),
                                                     AuthenticatorFactory));
 }
        /// <summary>
        /// Creates a <see cref="IWampChannel"/> that connects to a given realm,
        /// using the given address and the given binary binding
        /// </summary>
        /// <param name="address">The given address.</param>
        /// <param name="realm">The given realm to connect to.</param>
        /// <param name="binding">The given binary binding.</param>
        /// <param name="authenticator">The authenticator object to handle CHALLENGE request.</param>
        /// <returns></returns>
        public IWampChannel CreateChannel <TMessage>(string address,
                                                     string realm,
                                                     IWampBinaryBinding <TMessage> binding,
                                                     IWampClientAuthenticator authenticator)
        {
            Func <IControlledWampConnection <TMessage> > connectionFactory =
                () => new ControlledBinaryWebSocketConnection <TMessage>(new Uri(address), binding, null);

            return(this.CreateChannel(realm, connectionFactory, binding, authenticator));
        }
예제 #12
0
 protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>
     (WebSocketData connection,
     IWampBinaryBinding <TMessage> binding)
 {
     return(new BinaryWebSocketWrapperConnection <TMessage>
                (new OwinWebSocketWrapper(connection.WebSocketContext),
                binding,
                new OwinCookieProvider(connection.OwinContext),
                AuthenticatorFactory,
                mMaxFrameSize));
 }
예제 #13
0
        protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>
            (WebSocketData connection,
            IWampBinaryBinding <TMessage> binding)
        {
            ConfigureComputeBytes(binding);

            return(new BinaryWebSocketConnection <TMessage>
                       (connection.WebSocket,
                       binding,
                       new AspNetCoreCookieProvider(connection.HttpContext),
                       AuthenticatorFactory,
                       mMaxFrameSize));
        }
예제 #14
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");
        }
        private IControlledWampConnection <TMessage> GetConnectionFactory <TMessage>(IWampBinding <TMessage> binding)
        {
            IWampTextBinding <TMessage> textBinding = binding as IWampTextBinding <TMessage>;

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

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

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

            throw new Exception();
        }
예제 #16
0
 protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>(SocketData connection,
                                                                                 IWampBinaryBinding <TMessage>
                                                                                 binding)
 {
     return(CreateConnection(connection, binding));
 }
예제 #17
0
 protected IControlledWampConnection <TMessage> CreateBinaryConnection <TMessage>(IWampBinaryBinding <TMessage> binaryBinding)
 {
     return(new ControlledBinaryWebSocketConnection <TMessage>(ActivateWebSocket(), mServerAddress, binaryBinding));
 }
 /// <summary>
 /// Creates a new instance of <see cref="WebSocket4NetBinaryConnection{TMessage}"/>
 /// given the server address to connect to and the binary binding to use.
 /// </summary>
 /// <param name="serverAddress">The server address to connect to.</param>
 /// <param name="binding">The <see cref="IWampBinaryBinding{TMessage}"/> to use.</param>
 public WebSocket4NetBinaryConnection(string serverAddress, IWampBinaryBinding <TMessage> binding)
     : base(serverAddress, binding)
 {
     mBinding = binding;
     WebSocket.DataReceived += OnDataReceived;
 }
 /// <summary>
 /// Creates a new instance of <see cref="WebSocket4NetBinaryConnection{TMessage}"/>
 /// given the underlying <see cref="WebSocket"/> to use and the binary binding to use.
 /// </summary>
 /// <param name="webSocket">The underlying <see cref="WebSocket"/> to use..</param>
 /// <param name="binding">The <see cref="IWampTextBinding{TMessage}"/> to use.</param>
 public WebSocket4NetBinaryConnection(WebSocket webSocket, IWampBinaryBinding <TMessage> binding)
     : base(webSocket, binding)
 {
     mBinding = binding;
     WebSocket.DataReceived += OnDataReceived;
 }
 public ControlledBinaryWebSocketConnection(Uri addressUri, IWampBinaryBinding <TMessage> binding) :
     this(new ClientWebSocket(), addressUri, binding)
 {
 }
예제 #21
0
 protected override IWampConnection <TMessage> CreateBinaryConnection <TMessage>(IWebSocketConnection connection, IWampBinaryBinding <TMessage> binding)
 {
     return(new FleckWampBinaryConnection <TMessage>(connection, binding, AuthenticatorFactory));
 }
 public BinaryWebSocketConnection(WebSocket webSocket, IWampBinaryBinding <TMessage> binding, ICookieProvider cookieProvider, ICookieAuthenticatorFactory cookieAuthenticatorFactory) :
     base(webSocket, binding, cookieProvider, cookieAuthenticatorFactory)
 {
     mBinding = binding;
 }
예제 #23
0
 protected IControlledWampConnection <TMessage> CreateBinaryConnection <TMessage>(IWampBinaryBinding <TMessage> binaryBinding)
 {
     return(new WebSocket4NetBinaryConnection <TMessage>(mWebSocketFactory(binaryBinding.Name), binaryBinding));
 }
예제 #24
0
 protected BinaryWebSocketWrapperConnection(IClientWebSocketWrapper clientWebSocket, Uri addressUri, IWampBinaryBinding <TMessage> binding) :
     base(clientWebSocket, addressUri, binding.Name, binding)
 {
     mBinding = binding;
 }
예제 #25
0
 public MessageWebSocketBinaryConnection(string uri, IWampBinaryBinding <TMessage> binding) :
     base(uri, binding, SocketMessageType.Binary)
 {
     mBinaryBinding = binding;
 }
 protected BinaryWebSocketConnection(ClientWebSocket clientWebSocket, Uri addressUri,
                                     IWampBinaryBinding <TMessage> binding, int?maxFrameSize) : base(new ClientWebSocketWrapper(clientWebSocket), addressUri, binding, maxFrameSize)
 {
 }
 public ControlledBinaryWebSocketConnection(ClientWebSocket clientWebSocket, Uri addressUri, IWampBinaryBinding <TMessage> binding) :
     base(clientWebSocket, addressUri, binding)
 {
 }
 protected BinaryWebSocketConnection(Uri addressUri, IWampBinaryBinding <TMessage> binding) :
     base(addressUri, binding.Name, binding)
 {
     mBinding = binding;
 }
예제 #29
0
 /// <summary>
 /// Creates a binary <see cref="IWampConnection{TMessage}"/> using the given
 /// binding and the given connection.
 /// </summary>
 /// <param name="connection">The given connection.</param>
 /// <param name="binding">The given binding.</param>
 protected abstract IWampConnection <TMessage> CreateBinaryConnection <TMessage>
     (TConnection connection, IWampBinaryBinding <TMessage> binding);
예제 #30
0
 private IWampBinding CreateAuthenticationBinding <TMessage>
     (IWampBinaryBinding <TMessage> binding)
 {
     return(new WampAuthenticationBinaryBinding <TMessage>(binding, mSessionAuthenticationFactory, this.UriValidator));
 }