Skip to content
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

Invalid nested call #27

Open
lufinkey opened this issue Jun 12, 2024 · 1 comment
Open

Invalid nested call #27

lufinkey opened this issue Jun 12, 2024 · 1 comment
Assignees

Comments

@lufinkey
Copy link

Randomly when trying to disconnect emitter (on the same thread where Connect was called), I get an exception "Invalid nested call". This is inconsistent and only happens about half the time.

Here is the stack trace:

InvalidOperationException: Invalid nested call.
Mono.Net.Security.MobileAuthenticatedStream.GetInvalidNestedCallException () (at <babece01671744c6913f4a167b091f9e>:0)
Mono.Net.Security.MobileAuthenticatedStream.StartOperation (Mono.Net.Security.MobileAuthenticatedStream+OperationType type, Mono.Net.Security.AsyncProtocolRequest asyncRequest, System.Threading.CancellationToken cancellationToken) (at <babece01671744c6913f4a167b091f9e>:0)
Rethrow as AggregateException: One or more errors occurred. (Invalid nested call.)
System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at <bfbc89a04b6b4dd49c3614d03fc31ce8>:0)
System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) (at <bfbc89a04b6b4dd49c3614d03fc31ce8>:0)
System.Threading.Tasks.Task.Wait () (at <bfbc89a04b6b4dd49c3614d03fc31ce8>:0)
Mono.Net.Security.MobileAuthenticatedStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) (at <babece01671744c6913f4a167b091f9e>:0)
System.Net.Security.SslStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 count) (at <babece01671744c6913f4a167b091f9e>:0)
Emitter.MqttNetworkChannel.Send (System.Byte[] buffer) (at Assets/Plugins/EmitterIO/Emitter/Emitter/Net/MqttNetworkChannel.cs:302)
Emitter.MqttClient.Send (System.Byte[] msgBytes) (at Assets/Plugins/EmitterIO/Emitter/Emitter/MqttClient.cs:769)
Rethrow as MqttCommunicationException
Emitter.MqttClient.Send (System.Byte[] msgBytes) (at Assets/Plugins/EmitterIO/Emitter/Emitter/MqttClient.cs:780)
Emitter.MqttClient.Send (Emitter.Messages.MqttMsgBase msg) (at Assets/Plugins/EmitterIO/Emitter/Emitter/MqttClient.cs:793)
Emitter.MqttClient.Disconnect () (at Assets/Plugins/EmitterIO/Emitter/Emitter/MqttClient.cs:530)
Emitter.Connection.Disconnect () (at Assets/Plugins/EmitterIO/Emitter/Emitter/Emitter.cs:236)
@Florimond Florimond self-assigned this Jun 13, 2024
@Florimond
Copy link
Member

Thanks for the report.

I'm not sure I'm going to investigate this particular issue right now as I'm about to write a new version of this lib from scratch. This time it would be based on the very official MQTTNet, which MQTT lib didn't exist at the time we first wrote this Emitter SDK in C#. I think I'm going to try to speed up the writing of this new version instead of fixing the old one...

Since we have you here, would you like to tell us a bit about your use case? Do you have specific needs I could take into account before starting the rewrite?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants