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

Ui Freeze when broker doesn't respond #2

Open
wakatanka opened this issue May 11, 2019 · 3 comments
Open

Ui Freeze when broker doesn't respond #2

wakatanka opened this issue May 11, 2019 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wakatanka
Copy link

  • version of Unity3D 2018.all, 2019.1

Hi, i make mqtt autoconnect true and it works flawless, but if the mqtt broker is down all the ui remain freezed until timeout (put to 30sec). Is there a way to avoid this?

thanks for your great work

@gpvigano
Copy link
Owner

Hi, you can set the timeoutOnConnection field in M2MqttUnityClient to a smaller value, otherwise a best control over the connection should be implemented (in one of my projects I used a small timeout with a defined number of iterated trials, using a list of stored broker addresses and trying to connect to each of them until success).

I understand that this is more a workaround than a solution, sorry, maybe you can find a better support on M2MQTT site asking about MqttClient.

@gpvigano gpvigano added the good first issue Good for newcomers label May 13, 2019
@takemehi
Copy link

The issue can be resolved by connecting in a seperate Thread instead of using a coroutine.

@gpvigano
Copy link
Owner

Right. That's the solution (maybe also connecting in a separate thread and waiting for the thread completion in the coroutine). Anyway attention must be paid working with threads (mostly in Unity), exceptions should be handled, etc. I'm not a skilled multi-threading programmer, a pull request would be welcome here...

@gpvigano gpvigano added the help wanted Extra attention is needed label Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants