MCPcopy Create free account
hub / github.com/boostorg/asio / close_after

Class close_after

example/cpp11/timeouts/blocking_token_tcp_client.cpp:37–49  ·  view source on GitHub ↗

A custom completion token that makes asynchronous operations behave as though they are blocking calls with a timeout.

Source from the content-addressed store, hash-verified

35// A custom completion token that makes asynchronous operations behave as
36// though they are blocking calls with a timeout.
37struct close_after
38{
39 close_after(std::chrono::steady_clock::duration t, tcp_socket& s)
40 : timeout_(t), socket_(s)
41 {
42 }
43
44 // The maximum time to wait for an asynchronous operation to complete.
45 std::chrono::steady_clock::duration timeout_;
46
47 // The socket to be closed if the operation does not complete in time.
48 tcp_socket& socket_;
49};
50
51namespace boost {
52namespace asio {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected