mirror of https://github.com/eclipse/paho.mqtt.c
38 lines
3.6 KiB
HTML
38 lines
3.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<title>MQTT Client: Quality of service</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="contents">
|
|
|
|
|
|
<h1><a class="anchor" id="qos">Quality of service </a></h1><p>The MQTT protocol provides three qualities of service for delivering messages between clients and servers: "at most once", "at least once" and "exactly once".</p>
|
|
<p>Quality of service (QoS) is an attribute of an individual message being published. An application sets the QoS for a specific message by setting the <a class="el" href="struct_m_q_t_t_client__message.html#a35738099155a0e4f54050da474bab2e7">MQTTClient_message.qos</a> field to the required value.</p>
|
|
<p>A subscribing client can set the maximum quality of service a server uses to send messages that match the client subscriptions. The <a class="el" href="_m_q_t_t_client_8h.html#a326fb0ba7a16613ab7fc861f78232ccf">MQTTClient_subscribe()</a> and <a class="el" href="_m_q_t_t_client_8h.html#ad125c07aad06ca085b5fff40c333b533">MQTTClient_subscribeMany()</a> functions set this maximum. The QoS of a message forwarded to a subscriber thus might be different to the QoS given to the message by the original publisher. The lower of the two values is used to forward a message.</p>
|
|
<p>The three levels are:</p>
|
|
<p><b>QoS0, At most once:</b> The message is delivered at most once, or it may not be delivered at all. Its delivery across the network is not acknowledged. The message is not stored. The message could be lost if the client is disconnected, or if the server fails. QoS0 is the fastest mode of transfer. It is sometimes called "fire and forget".</p>
|
|
<p>The MQTT protocol does not require servers to forward publications at QoS0 to a client. If the client is disconnected at the time the server receives the publication, the publication might be discarded, depending on the server implementation.</p>
|
|
<p><b>QoS1, At least once:</b> The message is always delivered at least once. It might be delivered multiple times if there is a failure before an acknowledgment is received by the sender. The message must be stored locally at the sender, until the sender receives confirmation that the message has been published by the receiver. The message is stored in case the message must be sent again.</p>
|
|
<p><b>QoS2, Exactly once:</b> The message is always delivered exactly once. The message must be stored locally at the sender, until the sender receives confirmation that the message has been published by the receiver. The message is stored in case the message must be sent again. QoS2 is the safest, but slowest mode of transfer. A more sophisticated handshaking and acknowledgement sequence is used than for QoS1 to ensure no duplication of messages occurs. </p>
|
|
</div>
|
|
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 3 15:17:14 2012 for MQTT Client by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
|
|
</body>
|
|
</html>
|