mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
28 lines
526 B
C++
28 lines
526 B
C++
|
#ifndef WF_TEST_UTILS_WS_SERVER_HPP
|
||
|
#define WF_TEST_UTILS_WS_SERVER_HPP
|
||
|
|
||
|
#include <libwebsockets.h>
|
||
|
#include <jansson.h>
|
||
|
|
||
|
namespace webfuse_test
|
||
|
{
|
||
|
|
||
|
class WebsocketServer
|
||
|
{
|
||
|
WebsocketServer(WebsocketServer const &) = delete;
|
||
|
WebsocketServer & operator=(WebsocketServer const &) = delete;
|
||
|
public:
|
||
|
explicit WebsocketServer(int port);
|
||
|
~WebsocketServer();
|
||
|
void waitForConnection();
|
||
|
void sendMessage(json_t * message);
|
||
|
json_t * receiveMessage();
|
||
|
private:
|
||
|
class Private;
|
||
|
Private * d;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|