Increasing time out value

Asked by Durgadevi

We are connecting to mosquitto broker through wireless modem. since data transfer is slow through wireless modem we would to increase the timeout value. Can you tell us how to increase the timeout value on the broker side?

Question information

Language:
English Edit question
Status:
Answered
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roger Light (roger.light) said :
#1

There are two timeouts you could be referring to :)

The first is the time between a client connecting and it sending its CONNECT command. This is set to 60 seconds at the moment (although the server only disconnects the client at 60*1.5=90 seconds) and can only be set at compile time - see the line "context->core.keepalive = 60;" in context.c. I doubt this is what you are referring to because it doesn't really relate to data transfer speeds.

The second is the keepalive value set by the client. If the client doesn't communicate with the broker within the period 1.5*keepalive seconds then the broker will disconnect the client. Like I say, this is set by the client and it is the responsibility of the client to ensure that PINGREQ messages are sent to the broker if no other messages have been sent within the keepalive period.

The way you should deal with this depends very much on what you using for your client code. Assuming you're using libmosquitto, this is all handled for you and you just need to use the keepalive parameter in the mosquitto_connect() call to set your keepalive value. I can't comment on other client code because I haven't looked at any - you'd have to check their documentation.

Can you help with this problem?

Provide an answer of your own, or ask Durgadevi for more information if necessary.

To post a message you must log in.