Skip to content

Commit 197c0b2

Browse files
author
committed
Deployed 652279d with MkDocs version: 1.6.1
1 parent 5fe5c6c commit 197c0b2

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,5 +374,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
374374

375375
<!--
376376
MkDocs version : 1.6.1
377-
Build Date UTC : 2025-05-14 18:36:54.461033+00:00
377+
Build Date UTC : 2026-07-15 21:42:32.084976+00:00
378378
-->

‎search/search_index.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎sitemap.xml.gz‎

0 Bytes
Binary file not shown.

‎usage/index.html‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,20 @@ <h3 id="heartbeat_1">Heartbeat</h3>
506506
<pre><code class="language-cpp">int pingIntervalSeconds = 45;
507507
ix::WebSocketServer server(port, host, backlog, maxConnections, handshakeTimeoutSecs, addressFamily, pingIntervalSeconds);
508508
</code></pre>
509+
<h3 id="server-log-callback">Server log callback</h3>
510+
<p>By default the server writes internal errors to stderr (and some info messages to stdout). Errors that happen before a connection is fully established — for example a failed TLS handshake when a client presents a bad certificate — cannot be reported through <code>setOnClientMessageCallback</code>, since no WebSocket object exists yet at that point.</p>
511+
<p>To capture those messages in your application logs, set a log callback. It applies to <code>WebSocketServer</code> as well as <code>HttpServer</code>. When a callback is set, messages are delivered to it instead of being written to stderr/stdout.</p>
512+
<pre><code class="language-cpp">server.setLogCallback([](ix::LogLevel level, const std::string&amp; msg) {
513+
if (level == ix::LogLevel::Error)
514+
{
515+
myLogger.error(msg);
516+
}
517+
else
518+
{
519+
myLogger.info(msg);
520+
}
521+
});
522+
</code></pre>
509523
<h2 id="http-client-api">HTTP client API</h2>
510524
<pre><code class="language-cpp">#include &lt;ixwebsocket/IXHttpClient.h&gt;
511525

0 commit comments

Comments
 (0)