15 std::atomic<bool>
g_done(
false);
42 sender->send(std::make_shared<tasks::net::http_request>(
"localhost",
"/", 18080));
47 CPPUNIT_ASSERT_MESSAGE(std::string(
"send error: ") + error, send_ok);
51 std::this_thread::sleep_for(std::chrono::seconds(1));
62 auto request = std::make_shared<tasks::net::http_request>(
"localhost",
"/", 18080);
68 std::string error =
"";
70 sender->send(request);
75 CPPUNIT_ASSERT_MESSAGE(std::string(
"send error: ") + error, send_ok);
78 std::this_thread::sleep_for(std::chrono::seconds(1));
81 CPPUNIT_ASSERT_MESSAGE(std::string(
"g_status_code = ") + std::to_string(g_status_code), g_status_code == 404);
91 sender->send(request);
96 CPPUNIT_ASSERT_MESSAGE(std::string(
"send error: ") + error, send_ok);
99 std::this_thread::sleep_for(std::chrono::seconds(1));
102 CPPUNIT_ASSERT_MESSAGE(std::string(
"g_status_code = ") + std::to_string(g_status_code), g_status_code == 404);
117 CPPUNIT_ASSERT_MESSAGE(std::string(
"error: ") + sender->error_message(),
125 std::string error_str =
"";
128 sender->send(std::make_shared<tasks::net::http_request>(
"localhost",
"/", 18081));
136 std::this_thread::sleep_for(std::chrono::seconds(1));
static std::shared_ptr< dispatcher > instance()
Error on sendto sys call.
bool handle_response(std::shared_ptr< tasks::net::http_response > response)
std::string g_content_type
bool handle_response(std::shared_ptr< tasks::net::http_response > response)
void on_finish(finish_func_worker_t f)
const std::string & message() const noexcept
Return the error message.
std::atomic< bool > g_done(false)
const char * what() const noexcept
Return the error message.
Error when reading from a disconnected socket.
tasks_error error_code() const noexcept
Return the error code.
void requests_keepalive()
Error on recvfrom sys call.