Re: Fwd: Using ASIO to wait on a foreign socket being readable, with a timeout

Dominique Devienne via Boost-users <[email protected]> Fri, 19 Jan 2024 09:39:58 +0100
Newsgroups gmane.comp.lib.boost.user
Message-ID <CAFCRh-9HOPZKscV6Hbmy7r-yKYX0agj_ENbCwkcyf878V=gXPg@mail.gmail.com>
On Thu, Jan 18, 2024 at 8:19 PM Martijn Otto <[email protected]> wrote:

> ASIO will assume ownership of the socket, which means it'll close the
> socket when it's destructed. If you don't want this, you have to call
> `release()` on it before destructing.
>

Thanks Martijn!  Works for both outcomes now, and on Windows and Linux.
Although the wait times are rather different on Windows and Linux!
Linux adds 0.1ms overhead roughly, vs 20x - 100x that on Windows. --DD

PS: If anyone knows a better way to achieve the objective I outlined, I'd
appreciate.

Win64 Debug:     Waited 3,184 usec; Waited 107,721 usec
Win64 Release:   Waited 2,559 usec; Waited 111,448 usec
Linux64 Release: Waited   132 usec; Waited 100,096 usec
Linux64 Release: Waited   138 usec; Waited 100,101 usec
Linux64 Release: Waited   110 usec; Waited 100,094 usec

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users