Adds immediate migration results

This commit is contained in:
torsten committed 2026-08-18 22:12:24 +02:00
1 parent ba4121728b
commit 6a2a0667ab
2395 files changed
+357322 -2524

No files matched your search

@@ -0,0 +1,84 @@
/*
* (c) Copyright, Real-Time Innovations, 2024.
* All rights reserved.
*
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef CIVETWEBSOCKET_CONNECTION_H
#define CIVETWEBSOCKET_CONNECTION_H
#include <civetweb.h>
#include "WebSocketConnection.hpp"
namespace rti { namespace apputils { namespace websocket { namespace civetweb {
class CivetWebSocketConnection : public WebSocketConnection {
public:
explicit CivetWebSocketConnection(struct mg_connection *conn) : conn_(conn)
{
}
void send(const StringBuffer& msg)
{
struct mg_context *context = mg_get_context(conn_);
mg_lock_context(context);
mg_websocket_write(
conn_,
MG_WEBSOCKET_OPCODE_TEXT,
msg.c_str(),
msg.length());
mg_unlock_context(context);
}
void send_pong(const StringBuffer& msg)
{
mg_context *context = mg_get_context(conn_);
mg_lock_context(context);
mg_websocket_write(
conn_,
MG_WEBSOCKET_OPCODE_PONG,
msg.c_str(),
msg.length());
mg_unlock_context(context);
}
bool operator==(WebSocketConnection* conn)
{
return conn_ == static_cast<CivetWebSocketConnection *>(conn)->conn();
}
const struct mg_connection* conn() const
{
return conn_;
}
void close()
{
struct mg_context *context = mg_get_context(conn_);
mg_lock_context(context);
mg_close_connection(conn_);
mg_unlock_context(context);
}
private:
mg_connection* conn_;
};
}}}} // namespace rti::apputils::websocket::civetweb
#endif // CIVETWEBSOCKET_CONNECTION_H