Exemplo n.º 1
0
        public static async Task <TransportResponse> SendDisconnect(this Broker broker)
        {
            var message = new Message
            {
                Channel = "/meta/disconnect"
            };

            return(await broker.Send(message, CancellationToken.None));
        }
Exemplo n.º 2
0
        public static async Task <TransportResponse> SendConnect(this Broker broker, CancellationToken token)
        {
            var message = new Message()
            {
                Channel        = "/meta/connect",
                ConnectionType = "long-polling"
            };

            return(await broker.Send(message, token));
        }
Exemplo n.º 3
0
        public static async Task <TransportResponse> SendSubscribe(this Broker broker, string clientId, string channel)
        {
            var message = new Message
            {
                Channel      = "/meta/subscribe",
                ClientId     = clientId,
                Subscription = channel
            };

            return(await broker.Send(message, CancellationToken.None));
        }
Exemplo n.º 4
0
        public static async Task <TransportResponse> SendSubscribe(this Broker broker, string channel, Dictionary <string, object> extensions)
        {
            var message = new Message
            {
                Channel      = "/meta/subscribe",
                Subscription = channel,
                Extension    = extensions,
            };

            return(await broker.Send(message, CancellationToken.None));
        }
Exemplo n.º 5
0
        public static async Task <TransportResponse> SendHandshake(this Broker broker)
        {
            var message = new Message
            {
                Channel                  = "/meta/handshake",
                Version                  = "1.0",
                MinimumVersion           = "1.0",
                SupportedConnectionTypes = new[] { "long-polling" }
            };

            return(await broker.Send(message, CancellationToken.None));
        }