diff --git a/ChangeLog.txt b/ChangeLog.txt index 146cf713..68b68340 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -53,6 +53,7 @@ Clients: - Both clients can now load default configuration options from a file. - Add -1 (oneshot) option to mosquitto_sub. - Add --proxy SOCKS5 support for both clients. +- Pub client supports setting its keepalive. Closes bug #454852. Client library: - Add experimental SOCKS5 support. diff --git a/client/pub_client.c b/client/pub_client.c index dbdd3469..0d326849 100644 --- a/client/pub_client.c +++ b/client/pub_client.c @@ -200,7 +200,7 @@ void print_usage(void) mosquitto_lib_version(&major, &minor, &revision); printf("mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.\n"); printf("mosquitto_pub version %s running on libmosquitto %d.%d.%d.\n\n", VERSION, major, minor, revision); - printf("Usage: mosquitto_pub [-h host] [-p port] [-q qos] [-r] {-f file | -l | -n | -m message} -t topic\n"); + printf("Usage: mosquitto_pub [-h host] [-k keepalive] [-p port] [-q qos] [-r] {-f file | -l | -n | -m message} -t topic\n"); #ifdef WITH_SRV printf(" [-A bind_address] [-S]\n"); #else @@ -230,6 +230,7 @@ void print_usage(void) printf(" -i : id to use for this client. Defaults to mosquitto_pub_ appended with the process id.\n"); printf(" -I : define the client id as id_prefix appended with the process id. Useful for when the\n"); printf(" broker is using the clientid_prefixes option.\n"); + printf(" -k : keep alive in seconds for this client. Defaults to 60.\n"); printf(" -l : read messages from stdin, sending a separate message for each line.\n"); printf(" -m : message payload to send.\n"); printf(" -M : the maximum inflight messages for QoS 1/2..\n"); diff --git a/man/mosquitto_pub.1.xml b/man/mosquitto_pub.1.xml index 7520df51..320f847d 100644 --- a/man/mosquitto_pub.1.xml +++ b/man/mosquitto_pub.1.xml @@ -22,6 +22,7 @@ hostname client_id client id prefix + keepalive time port number message QoS @@ -207,6 +208,15 @@ point using encryption. + + + + + The number of seconds between sending PING commands + to the broker for the purposes of informing it we are still + connected and functioning. Defaults to 60 seconds. + +