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 JindalPosted Sep 11, 2019, 9:36 AM
Guest UserPosted Sep 11, 2019, 9:47 AM
Guest UserPosted Sep 11, 2019, 4:30 AM
Hemant JindalPosted Sep 11, 2019, 4:24 AM
Guest UserPosted Sep 11, 2019, 4:20 AM
Hemant JindalPosted Sep 11, 2019, 4:01 AM
Guest UserPosted Sep 11, 2019, 3:13 AM
Hemant JindalPosted Sep 11, 2019, 2:47 AM
az iot hub show --query properties.eventHubEndpoints.events.path --name {your IoT Hub name} and assign returned value to s_eventHubsCompatiblePath.
Guest UserPosted Sep 11, 2019, 12:44 AM
Hemant JindalPosted Sep 10, 2019, 10:31 AM
Guest UserPosted Sep 10, 2019, 8:19 AM
Hemant JindalPosted Sep 10, 2019, 8:11 AM
Guest UserPosted Sep 10, 2019, 7:49 AM
Hemant JindalPosted Sep 10, 2019, 6:20 AM
Hemant JindalPosted Sep 10, 2019, 6:19 AM