protected void CreateConnection(WebSocket socket, ConnectionDelegate <TIncoming, TOutcoming> onConnection)
        {
            var connection = new WebSocketConnection <TIncoming, TOutcoming>(socket, Handler);

            connection.StartReceiving();
            onConnection?.Invoke(connection);
        }
Ejemplo n.º 2
0
            public Task <ConnectionContext> ConnectAsync(TransferFormat transferFormat, string connectionId, string hubName, CancellationToken cancellationToken = default)
            {
                var connection = new TestConnectionContext();

                _connectCallback?.Invoke(connection);

                _waitForServerConnection.TrySetResult(connection);
                return(Task.FromResult <ConnectionContext>(connection));
            }
Ejemplo n.º 3
0
        public Task <ConnectionContext> ConnectAsync(HubServiceEndpoint endpoint, TransferFormat transferFormat, string connectionId, string target, CancellationToken cancellationToken = default, IDictionary <string, string> headers = null)
        {
            var connection = new TestConnectionContext();

            _connectCallback?.Invoke(connection);

            _waitForServerConnection.TrySetResult(connection);
            return(Task.FromResult <ConnectionContext>(connection));
        }