Azure-Samples / signalr-service-quickstart-serverless-chat

Serverless chat quickstart samples for Azure SignalR
MIT License
75 stars 62 forks source link

Unable to send out messages #3

Closed siuhleung7 closed 5 years ago

siuhleung7 commented 5 years ago

Suddenly the azure signalr service unable to send out messages. Central US, East Asia, Australia all unable to connect, connection timeout? why???

siuhleung7 commented 5 years ago

Executed 'Functions.messages' (Failed, Id=18300480-5556-4b44-b070-490199c8ace1) [31/01/2019 04:59:20] System.Private.CoreLib: Exception while executing function: Functions.chat-messaging. System.Net.Http: Operation timed out. System.Private.CoreLib: Operation timed out.

anthonychu commented 5 years ago

The SignalR Service extension that the samples use are old. The use the v1-preview API in SignalR Service that was recently deprecated. We will update the sample. Thanks for reporting the issue.

siuhleung7 commented 5 years ago

Thank you very much, one more question I tried to connect this sample via .Net Client, it was connected fine, but I cannot receive new message from signalr. It was working fine before....

                 connection = new HubConnectionBuilder()
                        .WithUrl(connectionInfo.Content.url, options =>
                        {
                            options.AccessTokenProvider = () =>
                                Task.FromResult(connectionInfo.Content.accessToken);
                        }
                     )
                    .Build();

                    connection.Closed += async (error) =>
                    {
                        await Task.Delay(new Random().Next(0, 5) * 1000);
                        await connection.StartAsync();
                    };

                    connection.On<Message>("newMessage", (message) =>
                    {
                        Console.WriteLine($"{message}");
                        //NewMessage(message);
                    });

    public class Message
    {
        public string sender;
        public string text;
    }