dotnet / MQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
MIT License
4.51k stars 1.07k forks source link

Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets #1002

Closed K1LL3R234 closed 4 years ago

K1LL3R234 commented 4 years ago

I get errors like this when running ws with mqtt the connection id changes depends on error? Any help?

info: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[14] Connection id "0HM3AG16SIDHK" communication error. System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at System.IO.Pipelines.Pipe.GetReadAsyncResult() at System.IO.Pipelines.Pipe.DefaultPipeReader.GetResult(Int16 token) at MQTTnet.AspNetCore.MqttConnectionContext.d37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.IO.Pipelines.PipeCompletion.ThrowLatchedException() at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result) at System.IO.Pipelines.Pipe.GetReadAsyncResult() at System.IO.Pipelines.Pipe.DefaultPipeReader.GetResult(Int16 token) at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.d26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.d__25.MoveNext()

JanEggers commented 4 years ago

its fine just set the loglevel of Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets to warning if that is bothering you.

you could also check that when the user leaves the site you close the websocket, but that will just lower the likelyness of these kind of messages.

K1LL3R234 commented 4 years ago

Can you explain to me where I should do it or how?

JanEggers commented 4 years ago

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1

K1LL3R234 commented 4 years ago

Thank you very much