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

Delay for a reconnect #163

Open
russellgsystems opened this issue Jan 7, 2021 · 2 comments
Open

Delay for a reconnect #163

russellgsystems opened this issue Jan 7, 2021 · 2 comments
Labels
question Further information is requested

Comments

@russellgsystems
Copy link

Hello @francois-normandin

I am seeing an error 56 being returned from the MQTT Client Send Packet with our production code. I am not sure why the client is returning error 56. I tried to create a simple example to reproduce it, but the example didn't exhibit the problem after a hour of testing. I did get Warning 55102, "Client is already disconnected" though. Our production code doesn't currently check to see if the connection is still good and reconnect if not. I am looking at your example VI and noticed that you have a timeout on the event structure of 100 milliseconds. If the timeout occurs you check to see if the client is still connected if not then you have an elapsed time that waits for 5 seconds before trying to reconnect. Is there a specific reason you selected 5 seconds or is that arbitrary?

image

The reason I ask is that we have a client which sends a command and waits for a response. If it returns a timeout error. The timeout period is set to 5 seconds by default, but it can changed since it is just an input. You have your elapsed time set to auto reset so we might not have to wait the entire 5 seconds if it was reset previously so it might not be an issue. Since we already have some existing code that uses 5 seconds would you suggest that we increase the timeout in our code or would you suggest we decrease the elapsed time to less than 5 seconds?

@francois-normandin
Copy link
Member

@russellgsystems the five seconds reconnection delay is arbitrary. I must say that there had not been a lot of testing for the default value of 100ms either, so it might be that your system has a longer latency, especially on a QoS=2. I'd start with a longer timeout.

@russellgsystems
Copy link
Author

Thanks @francois-normandin I will experiment with it.

Russell

@francois-normandin francois-normandin added the question Further information is requested label Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants