Ejemplo n.º 1
0
        async Task Handshake(CancellationToken cancellationToken)
        {
            context.SetConnectionState(ConnectionState.Connecting);

            var response = await context.Request(
                new
            {
                channel = "/meta/handshake",
                version = "1.0",
                supportedConnectionTypes = new[] { connectionType },
            },
                cancellationToken);

            currentConnection = new BayeuxConnection((string)response["clientId"], context);
            context.SetConnection(currentConnection);
            context.SetConnectionState(ConnectionState.Connected);
            ObtainAdvice(response);
        }
 internal void SetNewConnection(BayeuxConnection newConnection)
 {
     currentConnection = newConnection;
     subscriber.OnConnected();
 }