Wire Sysio Wire Sysion 1.0.0
|
Public Member Functions | |
connection (const string &endpoint) | |
connection () | |
~connection ()=default | |
bool | start_session () |
bool | socket_is_open () const |
const string & | peer_address () const |
void | set_connection_type (const string &peer_addr) |
bool | is_transactions_only_connection () const |
bool | is_blocks_only_connection () const |
void | set_heartbeat_timeout (std::chrono::milliseconds msec) |
connection_status | get_status () const |
bool | connected () |
bool | current () |
void | close (bool reconnect=true, bool shutdown=false) |
bool | populate_handshake (handshake_message &hello) |
bool | resolve_and_connect () |
void | connect (const std::shared_ptr< tcp::resolver > &resolver, tcp::resolver::results_type endpoints) |
void | start_read_message () |
bool | process_next_message (uint32_t message_length) |
Process the next message from the pending message buffer. | |
void | send_handshake () |
void | blk_send_branch (const block_id_type &msg_head_id) |
void | blk_send_branch_impl (uint32_t msg_head_num, uint32_t lib_num, uint32_t head_num) |
void | blk_send (const block_id_type &blkid) |
void | stop_send () |
void | enqueue (const net_message &msg) |
void | enqueue_block (const signed_block_ptr &sb, bool to_sync_queue=false) |
void | enqueue_buffer (const std::shared_ptr< std::vector< char > > &send_buffer, go_away_reason close_after_send, bool to_sync_queue=false) |
void | cancel_sync (go_away_reason) |
void | flush_queues () |
bool | enqueue_sync_block () |
void | request_sync_blocks (uint32_t start, uint32_t end) |
void | cancel_wait () |
void | sync_wait () |
void | fetch_wait () |
void | sync_timeout (boost::system::error_code ec) |
void | fetch_timeout (boost::system::error_code ec) |
void | queue_write (const std::shared_ptr< vector< char > > &buff, std::function< void(boost::system::error_code, std::size_t)> callback, bool to_sync_queue=false) |
void | do_queue_write () |
bool | is_valid (const handshake_message &msg) const |
void | handle_message (const handshake_message &msg) |
void | handle_message (const chain_size_message &msg) |
void | handle_message (const go_away_message &msg) |
void | handle_message (const notice_message &msg) |
void | handle_message (const request_message &msg) |
void | handle_message (const sync_request_message &msg) |
void | handle_message (const signed_block &msg)=delete |
void | handle_message (const block_id_type &id, signed_block_ptr msg) |
void | handle_message (const packed_transaction &msg)=delete |
void | handle_message (packed_transaction_ptr msg) |
void | process_signed_block (const block_id_type &id, signed_block_ptr msg, block_state_ptr bsp) |
fc::variant_object | get_logger_variant () const |
Peer Timestamps | |
Time message handling | |
tstamp | org {0} |
originate timestamp | |
tstamp | rec {0} |
receive timestamp | |
tstamp | dst {0} |
destination timestamp | |
tstamp | xmt {0} |
transmit timestamp | |
void | check_heartbeat (tstamp current_time) |
Check heartbeat time and send Time_message. | |
void | send_time () |
Populate and queue time_message. | |
void | send_time (const time_message &msg) |
Populate and queue time_message immediately using incoming time_message. | |
void | handle_message (const time_message &msg) |
Process time_message. | |
static tstamp | get_time () |
Read system time and convert to a 64 bit integer. | |
Definition at line 581 of file net_plugin.cpp.
|
explicit |
Definition at line 878 of file net_plugin.cpp.
sysio::connection::connection | ( | ) |
Definition at line 891 of file net_plugin.cpp.
|
default |
void sysio::connection::blk_send | ( | const block_id_type & | blkid | ) |
Definition at line 1104 of file net_plugin.cpp.
void sysio::connection::blk_send_branch | ( | const block_id_type & | msg_head_id | ) |
Definition at line 1029 of file net_plugin.cpp.
void sysio::connection::blk_send_branch_impl | ( | uint32_t | msg_head_num, |
uint32_t | lib_num, | ||
uint32_t | head_num ) |
Definition at line 1086 of file net_plugin.cpp.
void sysio::connection::cancel_sync | ( | go_away_reason | reason | ) |
Definition at line 1262 of file net_plugin.cpp.
void sysio::connection::cancel_wait | ( | ) |
Definition at line 1457 of file net_plugin.cpp.
void sysio::connection::check_heartbeat | ( | tstamp | current_time | ) |
Definition at line 1156 of file net_plugin.cpp.
void sysio::connection::close | ( | bool | reconnect = true, |
bool | shutdown = false ) |
reconnect | true if we should try and reconnect immediately after close |
shutdown | true only if plugin is shutting down |
Definition at line 985 of file net_plugin.cpp.
void sysio::connection::connect | ( | const std::shared_ptr< tcp::resolver > & | resolver, |
tcp::resolver::results_type | endpoints ) |
Definition at line 2343 of file net_plugin.cpp.
bool sysio::connection::connected | ( | ) |
Definition at line 973 of file net_plugin.cpp.
bool sysio::connection::current | ( | ) |
Definition at line 977 of file net_plugin.cpp.
void sysio::connection::do_queue_write | ( | ) |
Definition at line 1212 of file net_plugin.cpp.
void sysio::connection::enqueue | ( | const net_message & | msg | ) |
Definition at line 1414 of file net_plugin.cpp.
void sysio::connection::enqueue_block | ( | const signed_block_ptr & | sb, |
bool | to_sync_queue = false ) |
Definition at line 1427 of file net_plugin.cpp.
void sysio::connection::enqueue_buffer | ( | const std::shared_ptr< std::vector< char > > & | send_buffer, |
go_away_reason | close_after_send, | ||
bool | to_sync_queue = false ) |
Definition at line 1438 of file net_plugin.cpp.
bool sysio::connection::enqueue_sync_block | ( | ) |
Definition at line 1281 of file net_plugin.cpp.
void sysio::connection::fetch_timeout | ( | boost::system::error_code | ec | ) |
Definition at line 1495 of file net_plugin.cpp.
void sysio::connection::fetch_wait | ( | ) |
Definition at line 1474 of file net_plugin.cpp.
void sysio::connection::flush_queues | ( | ) |
Definition at line 981 of file net_plugin.cpp.
|
inline |
Definition at line 790 of file net_plugin.cpp.
connection_status sysio::connection::get_status | ( | ) | const |
Definition at line 943 of file net_plugin.cpp.
|
inlinestatic |
There are only two calls on this routine in the program. One when a packet arrives from the network and the other when a packet is placed on the send queue. Calls the kernel time of day routine and converts to a (at least) 64 bit integer.
Definition at line 729 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const block_id_type & | id, |
signed_block_ptr | msg ) |
Definition at line 3136 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const chain_size_message & | msg | ) |
Definition at line 2759 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const go_away_message & | msg | ) |
Definition at line 2922 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const handshake_message & | msg | ) |
Definition at line 2763 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const notice_message & | msg | ) |
Definition at line 2984 of file net_plugin.cpp.
|
delete |
void sysio::connection::handle_message | ( | const request_message & | msg | ) |
Definition at line 3045 of file net_plugin.cpp.
|
delete |
void sysio::connection::handle_message | ( | const sync_request_message & | msg | ) |
Definition at line 3087 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | const time_message & | msg | ) |
Calculate offset, delay and dispersion. Note carefully the implied processing. The first-order difference is done directly in 64-bit arithmetic, then the result is converted to floating double. All further processing is in floating-double arithmetic with rounding done by the hardware. This is necessary in order to avoid overflow and preserve precision.
Definition at line 2944 of file net_plugin.cpp.
void sysio::connection::handle_message | ( | packed_transaction_ptr | msg | ) |
Definition at line 3110 of file net_plugin.cpp.
|
inline |
Definition at line 595 of file net_plugin.cpp.
|
inline |
Definition at line 594 of file net_plugin.cpp.
bool sysio::connection::is_valid | ( | const handshake_message & | msg | ) | const |
Definition at line 2720 of file net_plugin.cpp.
|
inline |
Definition at line 591 of file net_plugin.cpp.
bool sysio::connection::populate_handshake | ( | handshake_message & | hello | ) |
Definition at line 3504 of file net_plugin.cpp.
bool sysio::connection::process_next_message | ( | uint32_t | message_length | ) |
Process the next message from the pending_message_buffer. message_length is the already determined length of the data part of the message that will handle the message. Returns true is successful. Returns false if an error was encountered unpacking or processing the message.
Definition at line 2560 of file net_plugin.cpp.
void sysio::connection::process_signed_block | ( | const block_id_type & | id, |
signed_block_ptr | msg, | ||
block_state_ptr | bsp ) |
Definition at line 3175 of file net_plugin.cpp.
void sysio::connection::queue_write | ( | const std::shared_ptr< vector< char > > & | buff, |
std::function< void(boost::system::error_code, std::size_t)> | callback, | ||
bool | to_sync_queue = false ) |
Definition at line 1200 of file net_plugin.cpp.
Definition at line 1504 of file net_plugin.cpp.
bool sysio::connection::resolve_and_connect | ( | ) |
Definition at line 2287 of file net_plugin.cpp.
void sysio::connection::send_handshake | ( | ) |
Definition at line 1137 of file net_plugin.cpp.
void sysio::connection::send_time | ( | ) |
void sysio::connection::send_time | ( | const time_message & | msg | ) |
Definition at line 1191 of file net_plugin.cpp.
void sysio::connection::set_connection_type | ( | const string & | peer_addr | ) |
Definition at line 918 of file net_plugin.cpp.
|
inline |
Definition at line 596 of file net_plugin.cpp.
|
inline |
Definition at line 590 of file net_plugin.cpp.
void sysio::connection::start_read_message | ( | ) |
Definition at line 2432 of file net_plugin.cpp.
bool sysio::connection::start_session | ( | ) |
Definition at line 954 of file net_plugin.cpp.
void sysio::connection::stop_send | ( | ) |
void sysio::connection::sync_timeout | ( | boost::system::error_code | ec | ) |
Definition at line 1485 of file net_plugin.cpp.
void sysio::connection::sync_wait | ( | ) |
Definition at line 1463 of file net_plugin.cpp.
block_status_monitor sysio::connection::block_status_monitor_ |
Definition at line 645 of file net_plugin.cpp.
queued_buffer sysio::connection::buffer_queue |
Definition at line 626 of file net_plugin.cpp.
|
mutable |
Definition at line 653 of file net_plugin.cpp.
fc::sha256 sysio::connection::conn_node_id |
Definition at line 628 of file net_plugin.cpp.
std::atomic<bool> sysio::connection::connecting {true} |
Definition at line 640 of file net_plugin.cpp.
const uint32_t sysio::connection::connection_id |
Definition at line 638 of file net_plugin.cpp.
std::atomic<uint16_t> sysio::connection::consecutive_immediate_connection_close = 0 |
Definition at line 646 of file net_plugin.cpp.
tstamp sysio::connection::dst {0} |
Definition at line 671 of file net_plugin.cpp.
block_id_type sysio::connection::fork_head |
Definition at line 657 of file net_plugin.cpp.
uint32_t sysio::connection::fork_head_num {0} |
Definition at line 658 of file net_plugin.cpp.
tstamp sysio::connection::hb_timeout {std::chrono::milliseconds{def_keepalive_interval}.count()} |
Definition at line 676 of file net_plugin.cpp.
fc::time_point sysio::connection::last_close |
Definition at line 659 of file net_plugin.cpp.
fc::time_point sysio::connection::last_dropped_trx_msg_time |
Definition at line 637 of file net_plugin.cpp.
handshake_message sysio::connection::last_handshake_recv |
Definition at line 655 of file net_plugin.cpp.
handshake_message sysio::connection::last_handshake_sent |
Definition at line 656 of file net_plugin.cpp.
std::optional<request_message> sysio::connection::last_req |
Definition at line 654 of file net_plugin.cpp.
tstamp sysio::connection::latest_blk_time {0} |
Definition at line 677 of file net_plugin.cpp.
tstamp sysio::connection::latest_msg_time {0} |
Definition at line 675 of file net_plugin.cpp.
string sysio::connection::local_endpoint_ip |
Definition at line 633 of file net_plugin.cpp.
string sysio::connection::local_endpoint_port |
Definition at line 634 of file net_plugin.cpp.
string sysio::connection::log_p2p_address |
Definition at line 630 of file net_plugin.cpp.
string sysio::connection::log_remote_endpoint_ip |
Definition at line 631 of file net_plugin.cpp.
string sysio::connection::log_remote_endpoint_port |
Definition at line 632 of file net_plugin.cpp.
uint16_t sysio::connection::net_version = net_version_max |
Definition at line 644 of file net_plugin.cpp.
std::atomic<go_away_reason> sysio::connection::no_retry {no_reason} |
Definition at line 651 of file net_plugin.cpp.
tstamp sysio::connection::org {0} |
Definition at line 669 of file net_plugin.cpp.
std::atomic<std::size_t> sysio::connection::outstanding_read_bytes {0} |
Definition at line 624 of file net_plugin.cpp.
fc::message_buffer<1024*1024> sysio::connection::pending_message_buffer |
Definition at line 623 of file net_plugin.cpp.
std::atomic<uint16_t> sysio::connection::protocol_version = 0 |
Definition at line 643 of file net_plugin.cpp.
tstamp sysio::connection::rec {0} |
Definition at line 670 of file net_plugin.cpp.
string sysio::connection::remote_endpoint_ip |
Definition at line 660 of file net_plugin.cpp.
boost::asio::steady_timer sysio::connection::response_expected_timer |
Definition at line 649 of file net_plugin.cpp.
std::mutex sysio::connection::response_expected_timer_mtx |
Definition at line 648 of file net_plugin.cpp.
int16_t sysio::connection::sent_handshake_count = 0 |
Definition at line 639 of file net_plugin.cpp.
string sysio::connection::short_conn_node_id |
Definition at line 629 of file net_plugin.cpp.
std::shared_ptr<tcp::socket> sysio::connection::socket |
Definition at line 621 of file net_plugin.cpp.
boost::asio::io_context::strand sysio::connection::strand |
Definition at line 620 of file net_plugin.cpp.
std::atomic<bool> sysio::connection::syncing {false} |
Definition at line 641 of file net_plugin.cpp.
std::atomic<uint32_t> sysio::connection::trx_in_progress_size {0} |
Definition at line 636 of file net_plugin.cpp.
tstamp sysio::connection::xmt {0} |
Definition at line 672 of file net_plugin.cpp.