-
Notifications
You must be signed in to change notification settings - Fork 225
(sample): Device streaming sample improvements and fixes #173
Conversation
@@ -16,6 +16,6 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.29.0-preview-*" /> | |||
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.32.0-preview-001" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgraded sample to use the latest version where this sample will work for net 5.0 as well
@@ -44,6 +44,8 @@ public async Task RunSampleAsync() | |||
|
|||
var receiveResult = await stream.ReceiveAsync(receiveBuffer, cts.Token).ConfigureAwait(false); | |||
Console.WriteLine($"Received stream data: {Encoding.UTF8.GetString(receiveBuffer, 0, receiveResult.Count)}"); | |||
|
|||
await stream.CloseAsync(WebSocketCloseStatus.NormalClosure, "Streaming completed", new CancellationToken()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample throws an exception without this
|
||
using ServiceClient serviceClient = ServiceClient.CreateFromConnectionString(s_connectionString, s_transportType); | ||
var sample = new DeviceStreamSample(serviceClient, s_deviceId); | ||
// Parse application parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding command line arguments for inputs
[Option( | ||
't', | ||
"TransportType", | ||
Default = TransportType.Amqp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we default to MQTT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TransportType enum in our service client does not have MQTT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, good point.
d224229
to
606850e
Compare
Updated the sample with some improvements