← Back to team overview

mosquitto-dev team mailing list archive

Re: [Question #136060]: Increasing time out value


Question #136060 on mosquitto changed:

    Status: Open => Answered

Roger Light proposed the following answer:
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.

You received this question notification because you are a member of
Mosquitto Dev, which is an answer contact for mosquitto.