Boost logo

Boost Users :

From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2020-12-14 18:10:57


On Wed, Nov 25, 2020 at 6:46 PM Niall Douglas via Boost-users <
boost-users_at_[hidden]> wrote:

> On 25/11/2020 10:54, Dominique Devienne via Boost-users wrote:
> > When I log the time it takes to resolve the server address and connect
> > to it, then issue my HTTP request, it takes over 1 second (Win10,
> > VS2019, C++17, Release, localhost for both client and server):
> > 2020-11-25T09:46:38.506180 Connected in 1.023s
> >
> > While the same on Linux (RH7.5) is just over 2ms:
> > 2020-11-25T09:45:45.517550 Connected in 0.000s
> >
> > That's a huge difference! Almost 500x...
>
> I can confirm that from libcurl wrapping ASIO, initiating a new HTTPS
> connection takes almost the same time whether from Linux or Windows.
>
int main(int argc, char* argv[])
{
    // Check command line arguments.
    if (argc != 5)
    {
        std::cerr << [...]
            " http-server-async 0.0.0.0 8080 . 1\n";
        return EXIT_FAILURE;
    }
    auto const address = net::ip::make_address(argv[1]);
[...]
    net::io_context ioc{threads};

    // Create and launch a listening port
    std::make_shared<listener>(
        ioc,
        tcp::endpoint{address, port},
        doc_root)->run();
[...]
    return EXIT_SUCCESS;

}

> Niall
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net