Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 39c99b2

Browse files
authored
Merge pull request #171 from Azure-Samples/azabbasi/fixQuickStart - Fix QuickStart samples build
2 parents 15a5e4f + 6765560 commit 39c99b2

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

iot-hub/Quickstarts/device-streams-proxy/device/DeviceLocalProxyStreamingSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.29.0-preview-*" />
17+
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.32.0-preview-001" />
1818
</ItemGroup>
19-
19+
2020
</Project>

iot-hub/Quickstarts/device-streams-proxy/device/DeviceStreamSample.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace Microsoft.Azure.Devices.Client.Samples
1414
{
1515
public class DeviceStreamSample
1616
{
17-
private DeviceClient _deviceClient;
18-
private String _host;
19-
private int _port;
17+
private readonly DeviceClient _deviceClient;
18+
private readonly string _host;
19+
private readonly int _port;
2020

21-
public DeviceStreamSample(DeviceClient deviceClient, String host, int port)
21+
public DeviceStreamSample(DeviceClient deviceClient, string host, int port)
2222
{
2323
_deviceClient = deviceClient;
2424
_host = host;
@@ -44,7 +44,7 @@ private static async Task HandleOutgoingDataAsync(NetworkStream localStream, Cli
4444
while (localStream.CanRead)
4545
{
4646
int receiveCount = await localStream.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
47-
47+
4848
await remoteStream.SendAsync(new ArraySegment<byte>(buffer, 0, receiveCount), WebSocketMessageType.Binary, true, cancellationToken).ConfigureAwait(false);
4949
}
5050
}
@@ -75,7 +75,7 @@ public async Task RunSampleAsync(bool acceptDeviceStreamingRequest, Cancellation
7575
{
7676
await _deviceClient.AcceptDeviceStreamRequestAsync(streamRequest, cancellationTokenSource.Token).ConfigureAwait(false);
7777

78-
using (ClientWebSocket webSocket = await DeviceStreamingCommon.GetStreamingClientAsync(streamRequest.Url, streamRequest.AuthorizationToken, cancellationTokenSource.Token).ConfigureAwait(false))
78+
using (ClientWebSocket webSocket = await DeviceStreamingCommon.GetStreamingClientAsync(streamRequest.Uri, streamRequest.AuthorizationToken, cancellationTokenSource.Token).ConfigureAwait(false))
7979
{
8080
using (TcpClient tcpClient = new TcpClient())
8181
{
@@ -93,7 +93,7 @@ await Task.WhenAny(
9393
}
9494
}
9595

96-
await webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, String.Empty, cancellationTokenSource.Token).ConfigureAwait(false);
96+
await webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, cancellationTokenSource.Token).ConfigureAwait(false);
9797
}
9898
}
9999
else

iot-hub/Quickstarts/device-streams-proxy/device/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.Azure.Devices.Client.Samples
99
{
1010
public static class Program
1111
{
12-
// String containing Hostname, Device Id & Device Key in one of the following formats:
12+
// String containing Host Name, Device Id & Device Key in one of the following formats:
1313
// "HostName=<iothub_host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>"
1414
// "HostName=<iothub_host_name>;CredentialType=SharedAccessSignature;DeviceId=<device_id>;SharedAccessSignature=SharedAccessSignature sr=<iot_host>/devices/<device_id>&sig=<token>&se=<expiry_time>";
1515

@@ -32,10 +32,10 @@ public static class Program
3232
private static string s_port = Environment.GetEnvironmentVariable("REMOTE_PORT");
3333

3434
// Select one of the following transports used by DeviceClient to connect to IoT Hub.
35-
private static TransportType s_transportType = TransportType.Amqp;
36-
//private static TransportType s_transportType = TransportType.Mqtt;
37-
//private static TransportType s_transportType = TransportType.Amqp_WebSocket_Only;
38-
//private static TransportType s_transportType = TransportType.Mqtt_WebSocket_Only;
35+
private static readonly TransportType s_transportType = TransportType.Amqp;
36+
//private static readonly TransportType s_transportType = TransportType.Mqtt;
37+
//private static readonly TransportType s_transportType = TransportType.Amqp_WebSocket_Only;
38+
//private static readonly TransportType s_transportType = TransportType.Mqtt_WebSocket_Only;
3939

4040
public static int Main(string[] args)
4141
{

iot-hub/Quickstarts/device-streams-proxy/service/DeviceStreamSample.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace Microsoft.Azure.Devices.Samples
1414
{
1515
public class DeviceStreamSample
1616
{
17-
private ServiceClient _serviceClient;
18-
private String _deviceId;
19-
private int _localPort;
17+
private readonly ServiceClient _serviceClient;
18+
private readonly string _deviceId;
19+
private readonly int _localPort;
2020

21-
public DeviceStreamSample(ServiceClient deviceClient, String deviceId, int localPort)
21+
public DeviceStreamSample(ServiceClient deviceClient, string deviceId, int localPort)
2222
{
2323
_serviceClient = deviceClient;
2424
_deviceId = deviceId;
@@ -66,7 +66,7 @@ private static async void HandleIncomingConnectionsAndCreateStreams(string devic
6666
try
6767
{
6868
using (var cancellationTokenSource = new CancellationTokenSource())
69-
using (var remoteStream = await DeviceStreamingCommon.GetStreamingClientAsync(result.Url, result.AuthorizationToken, cancellationTokenSource.Token).ConfigureAwait(false))
69+
using (var remoteStream = await DeviceStreamingCommon.GetStreamingClientAsync(result.Uri, result.AuthorizationToken, cancellationTokenSource.Token).ConfigureAwait(false))
7070
{
7171
Console.WriteLine("Starting streaming");
7272

@@ -75,7 +75,7 @@ await Task.WhenAny(
7575
HandleOutgoingDataAsync(localStream, remoteStream, cancellationTokenSource.Token)).ConfigureAwait(false);
7676
}
7777

78-
Console.WriteLine("Done streaming");
78+
Console.WriteLine("Done streaming");
7979
}
8080
catch (Exception ex)
8181
{

iot-hub/Quickstarts/device-streams-proxy/service/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public static class Program
2929
private static string s_port = Environment.GetEnvironmentVariable("LOCAL_PORT");
3030

3131
// Select one of the following transports used by ServiceClient to connect to IoT Hub.
32-
private static TransportType s_transportType = TransportType.Amqp;
33-
//private static TransportType s_transportType = TransportType.Amqp_WebSocket_Only;
32+
private static readonly TransportType s_transportType = TransportType.Amqp;
33+
//private static readonly TransportType s_transportType = TransportType.Amqp_WebSocket_Only;
3434

3535
public static int Main(string[] args)
3636
{

iot-hub/Quickstarts/device-streams-proxy/service/ServiceLocalProxyStreamingSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Azure.Devices" Version="1.27.0-preview-*" />
13+
<PackageReference Include="Microsoft.Azure.Devices" Version="1.28.0-preview-001" />
1414
</ItemGroup>
15-
15+
1616
<ItemGroup>
1717
<PackageReference Include="System.Net.WebSockets.Client" Version="4.3.2" />
1818
</ItemGroup>

0 commit comments

Comments
 (0)