Deployed 73b9c0b with MkDocs version: 1.1.2
This commit is contained in:
parent
2fbf0e49ca
commit
8b5d0d7114
@ -98,6 +98,10 @@
|
||||
|
||||
<li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a>
|
||||
<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>
|
||||
<ul class="nav flex-column">
|
||||
</ul>
|
||||
@ -987,6 +991,8 @@
|
||||
|
||||
<h1 id="changelog">Changelog</h1>
|
||||
<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>
|
||||
<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>
|
||||
|
@ -265,5 +265,5 @@ webSocket.send("hello world");
|
||||
|
||||
<!--
|
||||
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
18
sitemap.xml
18
sitemap.xml
@ -1,39 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-08-26</lastmod>
|
||||
<lastmod>2020-08-28</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
@ -361,10 +361,9 @@ ix::WebSocketServer server(port);
|
||||
|
||||
server.setOnConnectionCallback(
|
||||
[&server](std::weak_ptr<WebSocket> webSocket,
|
||||
std::shared_ptr<ConnectionState> connectionState,
|
||||
std::unique_ptr<ConnectionInfo> connectionInfo)
|
||||
std::shared_ptr<ConnectionState> connectionState)
|
||||
{
|
||||
std::cout << "Remote ip: " << connectionInfo->remoteIp << std::endl;
|
||||
std::cout << "Remote ip: " << connectionState->remoteIp << std::endl;
|
||||
|
||||
auto ws = webSocket.lock();
|
||||
if (ws)
|
||||
@ -436,13 +435,12 @@ server.wait();
|
||||
ix::WebSocketServer server(port);
|
||||
|
||||
server.setOnClientMessageCallback(std::shared_ptr<ConnectionState> connectionState,
|
||||
ConnectionInfo& connectionInfo,
|
||||
WebSocket& webSocket,
|
||||
const WebSocketMessagePtr& 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.
|
||||
std::cout << "Remote ip: " << connectionInfo.remoteIp << std::endl;
|
||||
std::cout << "Remote ip: " << connectionState->getRemoteIp();
|
||||
|
||||
if (msg->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>
|
||||
<pre><code class="cpp">setOnConnectionCallback(
|
||||
[this](HttpRequestPtr request,
|
||||
std::shared_ptr<ConnectionState> /*connectionState*/,
|
||||
std::unique_ptr<ConnectionInfo> connectionInfo) -> HttpResponsePtr
|
||||
std::shared_ptr<ConnectionState> connectionState) -> HttpResponsePtr
|
||||
{
|
||||
// Build a string for the response
|
||||
std::stringstream ss;
|
||||
ss << connectionInfo->remoteIp
|
||||
ss << connectionState->getRemoteIp();
|
||||
<< " "
|
||||
<< request->method
|
||||
<< " "
|
||||
|
Loading…
x
Reference in New Issue
Block a user