Hi Team
I am trying to readmessage2device, each time want to readmessage2device, i often get this websocket exception.
This method it does the following for running;
- private static async Task Main(string[] args)
- {
- Console.WriteLine("IoT Hub App - Read device to cloud messages.");
- var connectionString = new EventHubsConnectionStringBuilder(new Uri(s_eventHubsCompatibleEndpoint), s_eventHubsCompatiblePath, s_iotHubSasKeyName, s_iotHubSasKey);
- s_eventHubClient = EventHubClient.CreateFromConnectionString(connectionString.ToString());
- var runtimeInfo = await s_eventHubClient.GetRuntimeInformationAsync();
- var d2Partitions = runtimeInfo.PartitionIds;
- CancellationTokenSource cts = new CancellationTokenSource();
- Console.CancelKeyPress += (s, e) =>
- {
- e.Cancel = true;
- cts.Cancel();
- Console.WriteLine("Exiting...");
- };
- var tasks = new List
(); - foreach(string partition in d2Partitions)
- {
- tasks.Add(ReceiveMessagesFromDeviceAsync(partition, cts.Token));
- }
- Task.WaitAll(tasks.ToArray());
- }
- }
- }
What could be the reason for this? Firewall issue or network, cant seem to understand where its getting it from.
Hemant JindalRank #827 · 2.7K reputationPosted Sep 11, 2019, 5:36 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 10, 2019, 2:19 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 10, 2019, 2:20 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 10, 2019, 3:49 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 10, 2019, 4:11 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 10, 2019, 4:19 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 10, 2019, 6:31 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 10, 2019, 8:44 PM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 10, 2019, 10:47 PM EDT
az iot hub show --query properties.eventHubEndpoints.events.path --name {your IoT Hub name} and assign returned value to s_eventHubsCompatiblePath.
Guest UserRank #877 · 2.5K reputationPosted Sep 10, 2019, 11:13 PM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 11, 2019, 12:01 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 11, 2019, 12:20 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Sep 11, 2019, 12:24 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 11, 2019, 12:30 AM EDT
Guest UserRank #877 · 2.5K reputationPosted Sep 11, 2019, 5:47 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts