Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Connector.h
Go to the documentation of this file.
1#ifndef joedb_ssh_Connector_declared
2#define joedb_ssh_Connector_declared
3
6
7namespace joedb::ssh
8{
10 {
11 public:
13 (
14 const std::string &user,
15 const std::string &host,
16 const unsigned port,
17 const int verbosity,
18 const char * const b64_key,
19 const char * const passphrase,
20 const char * const remote_path
21 ):
22 Session(user, host, port, verbosity, b64_key, passphrase),
23 Forward_Channel(*this, remote_path)
24 {
25 }
26 };
27
28 /// @ingroup concurrency
30 {
31 private:
32 const std::string user;
33 const std::string host;
34 const unsigned port;
35 const int verbosity;
36 const char * const b64_key;
37 const char * const passphrase;
38 const std::string remote_path;
39
40 public:
42 (
43 std::string user,
44 std::string host,
45 const unsigned port,
46 const int verbosity,
47 const char * const b64_key,
48 const char * const passphrase,
49 std::string remote_path
50 ):
51 user(std::move(user)),
52 host(std::move(host)),
53 port(port),
54 verbosity(verbosity),
55 b64_key(b64_key),
56 passphrase(passphrase),
57 remote_path(std::move(remote_path))
58 {
59 }
60
61 std::unique_ptr<Channel> new_channel() const override
62 {
63 return std::make_unique<Session_And_Channel>
64 (
65 user,
66 host,
67 port,
68 verbosity,
69 b64_key,
70 passphrase,
71 remote_path.c_str()
72 );
73 }
74 };
75}
76
77#endif
Used by Robust_Connection to reconnect after an error.
Definition Connector.h:14
std::unique_ptr< Channel > new_channel() const override
Definition Connector.h:61
Connector(std::string user, std::string host, const unsigned port, const int verbosity, const char *const b64_key, const char *const passphrase, std::string remote_path)
Definition Connector.h:42
Session_And_Channel(const std::string &user, const std::string &host, const unsigned port, const int verbosity, const char *const b64_key, const char *const passphrase, const char *const remote_path)
Definition Connector.h:13
C++ wrappers for libssh.
Definition Connector.h:8