You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
falk-werner_webfuse/test/webfuse/utils/ws_server2.hpp

40 lines
800 B

#ifndef WF_TEST_UTILS_WS_SERVER2_HPP
#define WF_TEST_UTILS_WS_SERVER2_HPP
#include <jansson.h>
#include <string>
namespace webfuse_test
{
class IIvokationHandler
{
public:
virtual ~IIvokationHandler() = default;
virtual std::string Invoke(char const * method, json_t * params) = 0;
};
class WsServer2
{
WsServer2(WsServer2 const &) = delete;
WsServer2 & operator=(WsServer2 const & ) = delete;
public:
WsServer2(
IIvokationHandler& handler,
std::string const & protocol,
int port = 0,
bool enable_tls = false);
virtual ~WsServer2();
bool IsConnected();
std::string const & GetUrl() const;
4 years ago
void SendMessage(char const * message);
void SendMessage(json_t * message);
private:
class Private;
Private * d;
};
}
#endif