9 #include <condition_variable> 35 bool Connect(
const std::string& address,
int port,
bool verbose =
true);
41 void Send(
const SC2APIProtocol::Request* request);
49 bool Receive(SC2APIProtocol::Response*& response,
unsigned int timeout_ms);
54 void PopResponse(SC2APIProtocol::Response*& response);
58 void SetTimeoutCallback(std::function<
void()> callback);
60 void SetConnectionClosedCallback(std::function<
void()> callback);
64 bool HasConnection()
const;
77 void PushResponse(SC2APIProtocol::Response*& response);
88 std::deque<SC2APIProtocol::Response*> queue_;
90 std::condition_variable condition_;
92 std::atomic_bool has_response_;
Definition: sc2_connection.h:26
Definition: sc2_action.h:9
std::function< void()> connection_closed_callback_
Timeout callback.
Definition: sc2_connection.h:81
std::function< void()> timeout_callback_
Timeout callback.
Definition: sc2_connection.h:80
mg_connection * connection_
A pointer to the civetweb connection object.
Definition: sc2_connection.h:83
Definition: sc2_connection.h:16