1#ifndef WEBSOCKET_COMMUNICATOR_H
2#define WEBSOCKET_COMMUNICATOR_H
4#include <boost/asio/connect.hpp>
5#include <boost/asio/ip/tcp.hpp>
6#include <boost/beast/core.hpp>
7#include <boost/beast/websocket.hpp>
61 boost::asio::io_context context;
62 boost::beast::websocket::stream<boost::asio::ip::tcp::socket> websocket{
Represents a command sent to the ICL.
Definition command.h:13
Interface representing a communication channel with the ICL.
Definition communicator.h:12
Represents a response of the ICL.
Definition response.h:13
void open() override
Opens the communication channel with the ICL.
WebSocketCommunicator(std::string host, std::string port)
Constructs a communication channel with the ICL based on a host and port.
bool is_open() override
Checks if the communication channel is open or not.
Response request_with_response(const Command &command) override
Sends a command to the ICL and returns the response.
~WebSocketCommunicator() override=default
void close() override
Closes the communication channel with the ICL.