Fixed documentation to reflect available() requiring connected() for proper operation

This commit is contained in:
Noah Laptop 2019-06-11 11:29:37 -07:00
parent f3509c9875
commit 75bc956a8e
6 changed files with 48 additions and 47 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -350,7 +350,7 @@ template&lt;class C , size_t SessionCache = 1&gt; </div>
<p>Returns the number of bytes available to read from the data that has been received and decrypted. </p> <p>Returns the number of bytes available to read from the data that has been received and decrypted. </p>
<p>This function updates the state of the SSL engine (including writing any data, see <a class="el" href="class_s_s_l_client.html#a6b8ff53c10fe34aab1dc2561410f70bb">SSLClient::write</a>) and as a result should be called periodically when expecting data. Additionally, since if there are no bytes and if <a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> is false this function returns zero (this same behavior is found in EthernetClient), it is prudent to ensure in your own code that the preconditions are met before checking this function to prevent an ambiguous result.</p> <p>This function updates the state of the SSL engine (including writing any data, see <a class="el" href="class_s_s_l_client.html#a6b8ff53c10fe34aab1dc2561410f70bb">SSLClient::write</a>) and as a result should be called periodically when expecting data. Additionally, since if there are no bytes and if <a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> is false this function returns zero (this same behavior is found in EthernetClient), it is prudent to ensure in your own code that the preconditions are met before checking this function to prevent an ambiguous result.</p>
<p>The implementation for this function can be found in SSLClientImpl::available</p> <p>The implementation for this function can be found in SSLClientImpl::available</p>
<dl class="section pre"><dt>Precondition</dt><dd><a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> must be true.</dd></dl> <dl class="section pre"><dt>Precondition</dt><dd><a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> must be true. (Call <a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> before this function)</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes available (can be zero), or zero if any of the pre conditions aren't satisfied. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>The number of bytes available (can be zero), or zero if any of the pre conditions aren't satisfied. </dd></dl>
</div> </div>
@ -499,7 +499,7 @@ template&lt;class C , size_t SessionCache = 1&gt; </div>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Check if the device is connected. </p> <p>Check if the device is connected. </p>
<p>Use this function to determine if <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> is still connected and a SSL connection is active. It should be noted that <a class="el" href="class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e" title="Returns the number of bytes available to read from the data that has been received and decrypted.">SSLClient::available</a> should be preferred over this function for rapid polling&ndash;both functions send and receive data with the SSLClient::m_client device, however <a class="el" href="class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e" title="Returns the number of bytes available to read from the data that has been received and decrypted.">SSLClient::available</a> has some delays built in to protect SSLClient::m_client from being polled too frequently.</p> <p>Use this function to determine if <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> is still connected and a SSL connection is active. It should be noted that this function should be called before <a class="el" href="class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e" title="Returns the number of bytes available to read from the data that has been received and decrypted.">SSLClient::available</a>&ndash; both functions send and receive data with the SSLClient::m_client device, however <a class="el" href="class_s_s_l_client.html#a5d13fd2f32ee2ea65a1f3820f758e77e" title="Returns the number of bytes available to read from the data that has been received and decrypted.">SSLClient::available</a> has some delays built in to protect SSLClient::m_client from being polled too frequently, and <a class="el" href="class_s_s_l_client.html#a25e4414ab0c9424d09592f9567a678dc" title="Check if the device is connected.">SSLClient::connected</a> contains logic to ensure that if the socket is dropped <a class="el" href="class_s_s_l_client.html" title="The main SSLClient class. Check out README.md for more info.">SSLClient</a> will react accordingly.</p>
<p>The implementation for this function can be found in <a class="el" href="class_s_s_l_client_impl.html#a957984fa392550a7df86f758e9b14bfb">SSLClientImpl::connected_impl</a>.</p> <p>The implementation for this function can be found in <a class="el" href="class_s_s_l_client_impl.html#a957984fa392550a7df86f758e9b14bfb">SSLClientImpl::connected_impl</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>1 if connected, 0 if not </dd></dl> <dl class="section return"><dt>Returns</dt><dd>1 if connected, 0 if not </dd></dl>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -201,7 +201,7 @@ public:
* *
* The implementation for this function can be found in SSLClientImpl::available * The implementation for this function can be found in SSLClientImpl::available
* *
* @pre SSLClient::connected must be true. * @pre SSLClient::connected must be true. (Call SSLClient::connected before this function)
* *
* @returns The number of bytes available (can be zero), or zero if any of the pre * @returns The number of bytes available (can be zero), or zero if any of the pre
* conditions aren't satisfied. * conditions aren't satisfied.
@ -269,9 +269,10 @@ public:
* @brief Check if the device is connected. * @brief Check if the device is connected.
* *
* Use this function to determine if SSLClient is still connected and a SSL connection is active. * Use this function to determine if SSLClient is still connected and a SSL connection is active.
* It should be noted that SSLClient::available should be preferred over this function for rapid * It should be noted that this function should be called before SSLClient::available--
* polling--both functions send and receive data with the SSLClient::m_client device, however SSLClient::available * both functions send and receive data with the SSLClient::m_client device, however SSLClient::available
* has some delays built in to protect SSLClient::m_client from being polled too frequently. * has some delays built in to protect SSLClient::m_client from being polled too frequently, and SSLClient::connected
* contains logic to ensure that if the socket is dropped SSLClient will react accordingly.
* *
* The implementation for this function can be found in SSLClientImpl::connected_impl. * The implementation for this function can be found in SSLClientImpl::connected_impl.
* *