2020-06-16 21:57:41 +00:00
|
|
|
#ifndef WFP_TEST_UTILS_WS_SERVER_HPP
|
|
|
|
#define WFP_TEST_UTILS_WS_SERVER_HPP
|
2020-06-12 14:53:36 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace webfuse_test
|
|
|
|
{
|
|
|
|
|
|
|
|
class WsServer
|
|
|
|
{
|
|
|
|
WsServer(WsServer const &) = delete;
|
|
|
|
WsServer & operator=(WsServer const &) = delete;
|
|
|
|
public:
|
|
|
|
WsServer(std::string const & protocol, int port = 0);
|
|
|
|
~WsServer();
|
|
|
|
bool IsConnected();
|
|
|
|
std::string GetUrl() const;
|
2020-07-12 09:09:50 +00:00
|
|
|
void SendMessage(std::string const & message);
|
|
|
|
std::string ReceiveMessage();
|
2020-06-12 14:53:36 +00:00
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
Private * d;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|