Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
net_plugin.hpp
Go to the documentation of this file.
1#pragma once
5
6namespace sysio {
7 using namespace appbase;
8
10 string peer;
11 bool connecting = false;
12 bool syncing = false;
14 };
15
16 class net_plugin : public appbase::plugin<net_plugin>
17 {
18 public:
19 net_plugin();
20 virtual ~net_plugin();
21
23 virtual void set_program_options(options_description& cli, options_description& cfg) override;
24 void handle_sighup() override;
25
26 void plugin_initialize(const variables_map& options);
27 void plugin_startup();
28 void plugin_shutdown();
29
30 string connect( const string& endpoint );
31 string disconnect( const string& endpoint );
32 std::optional<connection_status> status( const string& endpoint )const;
34
35 private:
36 std::shared_ptr<class net_plugin_impl> my;
37 };
38
39}
40
41FC_REFLECT( sysio::connection_status, (peer)(connecting)(syncing)(last_handshake) )
vector< connection_status > connections() const
void plugin_initialize(const variables_map &options)
string disconnect(const string &endpoint)
std::optional< connection_status > status(const string &endpoint) const
void handle_sighup() override
string connect(const string &endpoint)
virtual void set_program_options(options_description &cli, options_description &cfg) override
#define APPBASE_PLUGIN_REQUIRES(PLUGINS)
Definition plugin.hpp:11
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
handshake_message last_handshake
void cli()