Skip to content

Commit d365a3b

Browse files
authored
Switch back to MQTT as default transport (#55)
1 parent 3b5f154 commit d365a3b

File tree

1 file changed

+3
-2
lines changed
  • content/dotnet-template-azure-iot-edge-module/CSharp

1 file changed

+3
-2
lines changed

content/dotnet-template-azure-iot-edge-module/CSharp/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace SampleModule
99
using System.Threading;
1010
using System.Threading.Tasks;
1111
using Microsoft.Azure.Devices.Client;
12+
using Microsoft.Azure.Devices.Client.Transport.Mqtt;
1213

1314
class Program
1415
{
@@ -41,8 +42,8 @@ public static Task WhenCancelled(CancellationToken cancellationToken)
4142
/// </summary>
4243
static async Task Init()
4344
{
44-
AmqpTransportSettings amqpSetting = new AmqpTransportSettings(TransportType.Amqp_Tcp_Only);
45-
ITransportSettings[] settings = { amqpSetting };
45+
MqttTransportSettings mqttSetting = new MqttTransportSettings(TransportType.Mqtt_Tcp_Only);
46+
ITransportSettings[] settings = { mqttSetting };
4647

4748
// Open a connection to the Edge runtime
4849
ModuleClient ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);

0 commit comments

Comments
 (0)