libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
event.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2#pragma once
3
4#include <sshpp/config.hpp>
5
7#include <sshpp/export.hpp>
8#include <sshpp/fwd.hpp>
9#include <sshpp/result.hpp>
10
11#include <chrono>
12
13namespace sshpp {
14
16class SSHPP_API Event {
17public:
18 Event();
19 ~Event();
20 Event(Event&&) noexcept;
21 Event& operator=(Event&&) noexcept;
22 Event(const Event&) = delete;
23
24 Result<void> try_add_session(Session&);
25 Result<void> try_remove_session(Session&);
26
27#if SSHPP_HAS_CONNECTOR
28 Result<void> try_add_connector(native_connector);
29 Result<void> try_remove_connector(native_connector);
30#endif
31
33 Result<void> try_poll(std::chrono::milliseconds timeout);
34
35 native_event native_handle() const noexcept { return native_; }
36
37private:
38 native_event native_ = nullptr;
39};
40
41} // namespace sshpp
42
43#if SSHPP_HEADER_ONLY
45#endif
Poll-loop integration seam around ssh_event. See docs/design/05 ยง5.5.
Definition event.hpp:16
Event(const Event &)=delete
native_event native_handle() const noexcept
Definition event.hpp:35
Definition result.hpp:16
Definition session.hpp:41
Definition auth.hpp:18
::ssh_event_struct * native_event
Definition native_fwd.hpp:30
::ssh_connector_struct * native_connector
Definition native_fwd.hpp:35