Deployed 73b9c0b with MkDocs version: 1.1.2

This commit is contained in:
2020-08-28 21:56:23 +00:00
parent 2fbf0e49ca
commit 8b5d0d7114
6 changed files with 23 additions and 20 deletions

View File

@ -98,6 +98,10 @@
<li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a> <li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a>
<ul class="nav flex-column"> <ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#1031-2020-08-28" class="nav-link">[10.3.1] - 2020-08-28</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#1030-2020-08-26" class="nav-link">[10.3.0] - 2020-08-26</a> <li class="nav-item" data-level="2"><a href="#1030-2020-08-26" class="nav-link">[10.3.0] - 2020-08-26</a>
<ul class="nav flex-column"> <ul class="nav flex-column">
</ul> </ul>
@ -987,6 +991,8 @@
<h1 id="changelog">Changelog</h1> <h1 id="changelog">Changelog</h1>
<p>All changes to this project will be documented in this file.</p> <p>All changes to this project will be documented in this file.</p>
<h2 id="1031-2020-08-28">[10.3.1] - 2020-08-28</h2>
<p>(socket servers) merge the ConnectionInfo class with the ConnectionState one, which simplify all the server apis</p>
<h2 id="1030-2020-08-26">[10.3.0] - 2020-08-26</h2> <h2 id="1030-2020-08-26">[10.3.0] - 2020-08-26</h2>
<p>(ws) set the main thread name, to help with debugging in XCode, gdb, lldb etc...</p> <p>(ws) set the main thread name, to help with debugging in XCode, gdb, lldb etc...</p>
<h2 id="1029-2020-08-19">[10.2.9] - 2020-08-19</h2> <h2 id="1029-2020-08-19">[10.2.9] - 2020-08-19</h2>

View File

@ -265,5 +265,5 @@ webSocket.send(&quot;hello world&quot;);
<!-- <!--
MkDocs version : 1.1.2 MkDocs version : 1.1.2
Build Date UTC : 2020-08-26 20:39:30.537238+00:00 Build Date UTC : 2020-08-28 21:56:23.371737+00:00
--> -->

File diff suppressed because one or more lines are too long

View File

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-26</lastmod> <lastmod>2020-08-28</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
</urlset> </urlset>

Binary file not shown.

View File

@ -361,10 +361,9 @@ ix::WebSocketServer server(port);
server.setOnConnectionCallback( server.setOnConnectionCallback(
[&amp;server](std::weak_ptr&lt;WebSocket&gt; webSocket, [&amp;server](std::weak_ptr&lt;WebSocket&gt; webSocket,
std::shared_ptr&lt;ConnectionState&gt; connectionState, std::shared_ptr&lt;ConnectionState&gt; connectionState)
std::unique_ptr&lt;ConnectionInfo&gt; connectionInfo)
{ {
std::cout &lt;&lt; &quot;Remote ip: &quot; &lt;&lt; connectionInfo-&gt;remoteIp &lt;&lt; std::endl; std::cout &lt;&lt; &quot;Remote ip: &quot; &lt;&lt; connectionState-&gt;remoteIp &lt;&lt; std::endl;
auto ws = webSocket.lock(); auto ws = webSocket.lock();
if (ws) if (ws)
@ -436,13 +435,12 @@ server.wait();
ix::WebSocketServer server(port); ix::WebSocketServer server(port);
server.setOnClientMessageCallback(std::shared_ptr&lt;ConnectionState&gt; connectionState, server.setOnClientMessageCallback(std::shared_ptr&lt;ConnectionState&gt; connectionState,
ConnectionInfo&amp; connectionInfo,
WebSocket&amp; webSocket, WebSocket&amp; webSocket,
const WebSocketMessagePtr&amp; msg) const WebSocketMessagePtr&amp; msg)
{ {
// The ConnectionInfo object contains information about the connection, // The ConnectionState object contains information about the connection,
// at this point only the client ip address and the port. // at this point only the client ip address and the port.
std::cout &lt;&lt; &quot;Remote ip: &quot; &lt;&lt; connectionInfo.remoteIp &lt;&lt; std::endl; std::cout &lt;&lt; &quot;Remote ip: &quot; &lt;&lt; connectionState-&gt;getRemoteIp();
if (msg-&gt;type == ix::WebSocketMessageType::Open) if (msg-&gt;type == ix::WebSocketMessageType::Open)
{ {
@ -589,12 +587,11 @@ server.wait();
<p>If you want to handle how requests are processed, implement the setOnConnectionCallback callback, which takes an HttpRequestPtr as input, and returns an HttpResponsePtr. You can look at HttpServer::setDefaultConnectionCallback for a slightly more advanced callback example.</p> <p>If you want to handle how requests are processed, implement the setOnConnectionCallback callback, which takes an HttpRequestPtr as input, and returns an HttpResponsePtr. You can look at HttpServer::setDefaultConnectionCallback for a slightly more advanced callback example.</p>
<pre><code class="cpp">setOnConnectionCallback( <pre><code class="cpp">setOnConnectionCallback(
[this](HttpRequestPtr request, [this](HttpRequestPtr request,
std::shared_ptr&lt;ConnectionState&gt; /*connectionState*/, std::shared_ptr&lt;ConnectionState&gt; connectionState) -&gt; HttpResponsePtr
std::unique_ptr&lt;ConnectionInfo&gt; connectionInfo) -&gt; HttpResponsePtr
{ {
// Build a string for the response // Build a string for the response
std::stringstream ss; std::stringstream ss;
ss &lt;&lt; connectionInfo-&gt;remoteIp ss &lt;&lt; connectionState-&gt;getRemoteIp();
&lt;&lt; &quot; &quot; &lt;&lt; &quot; &quot;
&lt;&lt; request-&gt;method &lt;&lt; request-&gt;method
&lt;&lt; &quot; &quot; &lt;&lt; &quot; &quot;