コード例 #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);
        }
コード例 #2
0
 internal void SetNewConnection(BayeuxConnection newConnection)
 {
     currentConnection = newConnection;
     subscriber.OnConnected();
 }