-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] selecting MQTT as DeviceClient transport type causes WPF app to hangs on close? #2163
Comments
Thanks for the repro code I will take a look. |
@ZmorzynskiK Just wanted to keep an update here. The PR above does fix the issue, I just need to make sure that this implementation passes all our our tests which have had some issues the past few weeks. Once all is passing I'll update the thread. |
@jamdavi great, thanks for the update. |
@jamdavi I see that the PR is still being worked on. The original bug report indicates that the issue occurs in a WPF app. We're experiencing the same hanging issue with a simple Console application that just opens a connection and closes it again. It would be great if this could be resolved soon. |
Just an update for all who might be looking at this. We tracked the issue down to a change with DotNetty. The following PR has been merged and we will take a new version of DotNetty to fix. |
We had been waiting on a release from the Netty team and discussed internally the best way to handle the update. The Netty team created a new version of the Common library and we are now taking a dependency on this new version of the library. This is not required once we release the new SDK but if you want to test this out you can also take a dependency on the latest version of DotNetty.Common and it should replace the assembly at build time. Note, if you're targeting .NET Full framework such as net472 you'll have to use a binding redirect in your app.config. Visual Studio has an option to generate one automatically. |
This is now fixed with version 1.40.0 [https://github.com/Azure/azure-iot-sdk-csharp/releases/tag/2022_01_26]. |
Context
Description of the issue
I've stumbled upon a strange issue when creating and using
DeviceClient.Create
in WPF app withTransport.Mqtt
.I'm sending a message to IoT Hub and when closing the main window, the application just hangs and never terminates.
When I select
TransportType.Amqp
this hang does not occur and the application terminates correctly.Code sample exhibiting the issue
Create a simple WPF application, add two buttons in XAML:
then in codebehind set this code (set your own credentials for device):
You will see that clicking "Send with MQTT" will hang the app when closing and "Send with AQMP" will not hang when closing.
Is there an issue or am I doing something wrong?
all the best
Krzysztof
The text was updated successfully, but these errors were encountered: