TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
479.8k
System.Net.Sockets.SocketException
Sep 10 2019 6:01 AM
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<Task>();
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.
Reply
Answers (
15
)
EventHubsConnectionStringBuilder
UnathorizedException Error?