mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-09 01:01:11 +08:00
parent
570c3674fb
commit
c1e488cb88
@ -3,6 +3,9 @@ Broker:
|
||||
then try "nobody" instead. This reduces the burden on users installing
|
||||
Mosquitto themselves.
|
||||
|
||||
Clients:
|
||||
- Add timeout return code (27) for `mosquitto_sub -W <secs>` and
|
||||
`mosquitto_rr -W <secs>`. Closes #275.
|
||||
|
||||
1.6.4 - 20190801
|
||||
================
|
||||
|
@ -51,6 +51,7 @@ struct mosq_config cfg;
|
||||
bool process_messages = true;
|
||||
int msg_count = 0;
|
||||
struct mosquitto *mosq = NULL;
|
||||
static bool timed_out = false;
|
||||
|
||||
#ifndef WIN32
|
||||
void my_signal_handler(int signum)
|
||||
@ -58,6 +59,7 @@ void my_signal_handler(int signum)
|
||||
if(signum == SIGALRM){
|
||||
process_messages = false;
|
||||
mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props);
|
||||
timed_out = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -359,7 +361,10 @@ int main(int argc, char *argv[])
|
||||
rc = 0;
|
||||
}
|
||||
client_config_cleanup(&cfg);
|
||||
if(rc){
|
||||
if(timed_out){
|
||||
err_printf(&cfg, "Timed out\n");
|
||||
return MOSQ_ERR_TIMEOUT;
|
||||
}else if(rc){
|
||||
err_printf(&cfg, "Error: %s\n", mosquitto_strerror(rc));
|
||||
}
|
||||
return rc;
|
||||
|
@ -40,6 +40,7 @@ bool process_messages = true;
|
||||
int msg_count = 0;
|
||||
struct mosquitto *mosq = NULL;
|
||||
int last_mid = 0;
|
||||
static bool timed_out = false;
|
||||
|
||||
#ifndef WIN32
|
||||
void my_signal_handler(int signum)
|
||||
@ -47,6 +48,7 @@ void my_signal_handler(int signum)
|
||||
if(signum == SIGALRM){
|
||||
process_messages = false;
|
||||
mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props);
|
||||
timed_out = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -356,7 +358,10 @@ int main(int argc, char *argv[])
|
||||
rc = 0;
|
||||
}
|
||||
client_config_cleanup(&cfg);
|
||||
if(rc){
|
||||
if(timed_out){
|
||||
err_printf(&cfg, "Timed out\n");
|
||||
return MOSQ_ERR_TIMEOUT;
|
||||
}else if(rc){
|
||||
err_printf(&cfg, "Error: %s\n", mosquitto_strerror(rc));
|
||||
}
|
||||
return rc;
|
||||
|
@ -98,6 +98,7 @@ enum mosq_err_t {
|
||||
MOSQ_ERR_QOS_NOT_SUPPORTED = 24,
|
||||
MOSQ_ERR_OVERSIZE_PACKET = 25,
|
||||
MOSQ_ERR_OCSP = 26,
|
||||
MOSQ_ERR_TIMEOUT = 27,
|
||||
};
|
||||
|
||||
/* Option values */
|
||||
|
@ -783,6 +783,24 @@
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Exit Values</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>0</option></term>
|
||||
<listitem><para>Success</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>27</option></term>
|
||||
<listitem><para>Timed out waiting for message</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>Other non-zero value</option></term>
|
||||
<listitem><para>Unspecified failure</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
|
@ -924,6 +924,24 @@ mosquitto_sub -t 'bbc/#' -T bbc/bbc1 --remove-retained</programlisting>
|
||||
</itemizedlist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Exit Values</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>0</option></term>
|
||||
<listitem><para>Success</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>27</option></term>
|
||||
<listitem><para>Timed out waiting for message</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>Other non-zero value</option></term>
|
||||
<listitem><para>Unspecified failure</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
|
Loading…
x
Reference in New Issue
Block a user