#include #include #include #include #include int main() { trantor::Logger::setLogLevel(trantor::Logger::TRACE); struct hostent* he = gethostbyname("www.baidu.com"); struct in_addr addr; if (he && he->h_addrtype == AF_INET) { addr = *reinterpret_cast(he->h_addr); struct sockaddr_in ad; bzero(&ad, sizeof ad); ad.sin_family = AF_INET; ad.sin_addr=addr; trantor::InetAddress netaddr(ad); auto client=HttpAppFramework::instance().newHttpClient(netaddr.toIp(),80); auto req=HttpAppFramework::instance().newHttpRequest(); req->setMethod(drogon::HttpRequest::kGet); for(int i=0;i<10;i++) client->sendRequest(req,[](ReqResult result,const HttpResponse &response){ std::cout<<"receive response!"<