22 typedef std::pair<struct mg_connection*, SC2APIProtocol::Request*> RequestData;
23 typedef std::pair<struct mg_connection*, SC2APIProtocol::Response*> ResponseData;
31 const char* listeningPorts,
32 const char* requestTimeoutMs,
33 const char* websocketTimeoutMs,
34 const char* numThreads);
36 void QueueRequest(
struct mg_connection* conn, SC2APIProtocol::Request*& request);
37 void QueueResponse(
struct mg_connection* conn, SC2APIProtocol::Response*& response);
40 void SendRequest(
struct mg_connection* conn =
nullptr);
41 void SendResponse(
struct mg_connection* conn =
nullptr);
46 const RequestData& PeekRequest();
47 const ResponseData& PeekResponse();
49 std::vector<const mg_connection*> connections_;
51 mg_context* mg_context_ =
nullptr;
53 std::queue<RequestData> requests_;
54 std::queue<ResponseData> responses_;
56 std::mutex request_mutex_;
57 std::mutex response_mutex_;
Definition: sc2_action.h:9
Definition: sc2_server.h:25
Definition: sc2_connection.h:16