I have created an Azure IoT edge gateway running in Docker with a custom module that is just a pass through (takes the message and sends it upstream).
I created a simple .net console application to send a message to the gateway so that it can be evaluated.
This is the code that I have in the console app.
DeviceClient client =
DeviceClient.CreateFromConnectionString("HostName=<my iot hub in azure>.azure-devices.net;DeviceId=<the name of the device>;SharedAccessKey=<my access key>;GatewayHostName=<the name of the IoT Edge Device>");
Message message = new Message();
message.Properties.Add("testproperty", "test");
client.SendEventAsync(message).Wait();
It appears that when the SendEventAsync method is called that it will hang forerver. I waited 5 minutes and the app is stuck waiting. If I remove the GatewayHostName from the connection string it executes immediately and my message is sent directly to the IoT Hub in Azure.
Why will it not send the message to the IoT Edge gateway?