OpenVPN 3 Core Library
Loading...
Searching...
No Matches
asiowork.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12// A null Asio unit of work, that prevents the Asio event loop from
13// exiting.
14
15#ifndef OPENVPN_ASIO_ASIOWORK_H
16#define OPENVPN_ASIO_ASIOWORK_H
17
18#include <openvpn/io/io.hpp>
19
20namespace openvpn {
22{
23 public:
24 AsioWork(openvpn_io::io_context &io_context)
25 : work(openvpn_io::make_work_guard(io_context))
26 {
27 }
28
29 private:
30 openvpn_io::executor_work_guard<openvpn_io::io_context::executor_type> work;
31};
32} // namespace openvpn
33
34#endif
AsioWork(openvpn_io::io_context &io_context)
Definition asiowork.hpp:24
openvpn_io::executor_work_guard< openvpn_io::io_context::executor_type > work
Definition asiowork.hpp:30