System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. #1865
DoctorMcKay
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MQTTnet Version: 4.3.1.873
Mono Version: 6.12.0.200 (tarball Tue Jul 11 21:37:50 UTC 2023)
I've encountered an app crash due to the titled exception, and I can't tell whether it's a bug in MQTTnet or if I'm using it wrong and not handling an exception somewhere that I need to be. The RST is being encountered while attempting to connect.
Here is my code.
App logs indicate that MqttClient.ConnectAsync was called, then my 10-second timer elapses and signals cancellation to MqttClient using the cancellation token, and OperationCanceledException is called as expected. Here's my annotated log:
And here is the full exception info:
And here's the stack trace with newlines inserted:
I tried reproducing the issue by writing a server that resets the TCP connection before sending the full CONNACK response, but I wasn't able to reproduce it, whether I sent the RST before or after the cancellation token is signaled. I tried under both Windows and Mono with no luck.
Any help is appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions