#include <connection_table.h>
Collaboration diagram for connection_table:

Public Types | |
| enum | sides { LOCAL_LINK, REMOTE_LINK, LOCAL_REAL } |
Public Member Functions | |
| connection_table (int heartbeats_count, int freshness_period, int ghost_period) | |
| virtual | ~connection_table () |
| IMPLEMENT_CLASS_NAME ("connection_table") | |
| bool | live (const connection_id &conn_id) |
| bool | connected (const connection_id &conn_id) |
| connection_id | add (const connection &to_add) |
| connection_id | update (const connection &to_update) |
| bool | find (const connection_id &conn_id, connection &to_fill) |
| bool | zap (const connection_id &conn_id) |
| bool | transport_connected (const transport_id &tran_id) |
| int | count_users (const transport_id &real_id, const transport_id &ignored_link_id, int low_level_id, int level) |
| connection_id | find_linked (sides side, const transport_id &tran_id) |
| connection_id | find_low_level (network_address::address_type type, int low_level_id, int level=0) |
| connection_id | find_destination (const transport_id &real_id, const network_address &destination) |
| transport_id | socket_to_real_transport (network_address::address_type type, int socket, transport_id &linked_id) |
| connection_id | find_state (const transport_id &real_id, connection::states to_find, int low_level) |
| int | get_low_level_id (const transport_id &real_id, int level) |
| void | clear_dead () |
| bool | reset_time (const connection_id &conn_id) |
| bool | kabump (const connection_id &conn_id) |
| bool | record_request (const connection_id &conn_id) |
| bool | made_request (const connection_id &conn_id) |
| heartbeat | liveness (const connection_id &conn_id) |
| bool | set_liveness (const connection_id &conn_id, const heartbeat &new_liveness) |
| void | show_connections (istring &output, int indentation=0, bool alive_only=false) |
| int | connections () const |
| connection::states | get_conn_state (const transport_id &tran_id) |
| bool | set_conn_state (const transport_id &tran_id, connection::states state) |
| int | set_conn_states (const transport_id &real_id, connection::states state) |
| bool | owns_connection (const connection_id &conn_id, const transport_id &link_id) |
| int | connections_on_primary (const transport_id &real_id, const transport_id &ignored_link_id, int primary_id) |
| void | complain_missing_connection (const connection_id &conn_id, const istring &where) const |
| int_set | find_related_conns (int low_level_primary, int real_transport) |
| int_set | find_live_reals () |
| connection_id | find_dupe (int real_transport, int low_level_primary, const network_address &sender, int other_side_transport) |
Definition at line 28 of file connection_table.h.
| connection_table::connection_table | ( | int | heartbeats_count, | |
| int | freshness_period, | |||
| int | ghost_period | |||
| ) |
Definition at line 53 of file connection_table.cpp.
| connection_table::~connection_table | ( | ) | [virtual] |
| connection_table::IMPLEMENT_CLASS_NAME | ( | "connection_table" | ) |
| bool connection_table::live | ( | const connection_id & | conn_id | ) |
Definition at line 135 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, FUNCDEF, and unique_id< uniquifier >::raw_id().
| bool connection_table::connected | ( | const connection_id & | conn_id | ) |
Definition at line 101 of file connection_table.cpp.
References AUTO_LOCK, connection::connected(), FUNCDEF, and unique_id< uniquifier >::raw_id().
Referenced by transport_connected().
| connection_id connection_table::add | ( | const connection & | to_add | ) |
Definition at line 333 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), connection::DISCONNECTED, find_linked(), FUNCDEF, connection::liveness, LOCAL_LINK, connection::local_transport_id, LOG, unique_id< uniquifier >::raw_id(), istring::SPRINTF, and connection::state().
| connection_id connection_table::update | ( | const connection & | to_update | ) |
Definition at line 299 of file connection_table.cpp.
References AUTO_LOCK, complain_missing_connection(), connection::conn_id(), FUNCDEF, FUNCTION, and unique_id< uniquifier >::raw_id().
| bool connection_table::find | ( | const connection_id & | conn_id, | |
| connection & | to_fill | |||
| ) |
Definition at line 318 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, FUNCDEF, and unique_id< uniquifier >::raw_id().
Referenced by owns_connection().
| bool connection_table::zap | ( | const connection_id & | conn_id | ) |
Definition at line 361 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, FUNCDEF, connection::liveness, and unique_id< uniquifier >::raw_id().
| bool connection_table::transport_connected | ( | const transport_id & | tran_id | ) |
Definition at line 111 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::connected(), connected(), FUNCDEF, connection::local_transport_id, and connection::real_transport_id.
| int connection_table::count_users | ( | const transport_id & | real_id, | |
| const transport_id & | ignored_link_id, | |||
| int | low_level_id, | |||
| int | level | |||
| ) |
Definition at line 276 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::DISCONNECTED, FUNCDEF, connection::local_transport_id, connection::low_level, connection::real_transport_id, and connection::state().
Referenced by connections_on_primary().
| connection_id connection_table::find_linked | ( | sides | side, | |
| const transport_id & | tran_id | |||
| ) |
Definition at line 187 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), LOCAL_LINK, LOCAL_REAL, connection::local_transport_id, connection::real_transport_id, REMOTE_LINK, and connection::remote_transport_id.
Referenced by add(), get_conn_state(), and set_conn_state().
| connection_id connection_table::find_low_level | ( | network_address::address_type | type, | |
| int | low_level_id, | |||
| int | level = 0 | |||
| ) |
Definition at line 208 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), FUNCDEF, connection::low_level, connection::remote_host, and network_address::type().
| connection_id connection_table::find_destination | ( | const transport_id & | real_id, | |
| const network_address & | destination | |||
| ) |
Definition at line 226 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), FUNCDEF, connection::real_transport_id, and connection::remote_host.
| transport_id connection_table::socket_to_real_transport | ( | network_address::address_type | type, | |
| int | socket, | |||
| transport_id & | linked_id | |||
| ) |
Definition at line 479 of file connection_table.cpp.
References AUTO_LOCK, FUNCDEF, GET_CONN_ENTRY, LOG, PRIMARY_ID, unique_id< uniquifier >::raw_id(), SECONDARY_ID, and istring::SPRINTF.
| connection_id connection_table::find_state | ( | const transport_id & | real_id, | |
| connection::states | to_find, | |||
| int | low_level | |||
| ) |
Definition at line 81 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), FUNCDEF, connection::low_level, negative(), PRIMARY_ID, connection::real_transport_id, and connection::state().
| int connection_table::get_low_level_id | ( | const transport_id & | real_id, | |
| int | level | |||
| ) |
Definition at line 245 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::connected(), FUNCDEF, connection::low_level, and connection::real_transport_id.
| void connection_table::clear_dead | ( | ) |
Definition at line 374 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), heartbeat::dead(), heartbeat::due(), FUNCDEF, connection::liveness, LOG, heartbeat::made_request(), and istring::SPRINTF.
| bool connection_table::reset_time | ( | const connection_id & | conn_id | ) |
Definition at line 145 of file connection_table.cpp.
References AUTO_LOCK, FUNCDEF, heartbeat::kabump(), connection::liveness, and unique_id< uniquifier >::raw_id().
| bool connection_table::kabump | ( | const connection_id & | conn_id | ) | [inline] |
Definition at line 129 of file connection_table.h.
| bool connection_table::record_request | ( | const connection_id & | conn_id | ) |
Definition at line 176 of file connection_table.cpp.
References AUTO_LOCK, FUNCDEF, connection::liveness, heartbeat::made_request(), and unique_id< uniquifier >::raw_id().
| bool connection_table::made_request | ( | const connection_id & | conn_id | ) | [inline] |
Definition at line 135 of file connection_table.h.
| heartbeat connection_table::liveness | ( | const connection_id & | conn_id | ) |
Definition at line 156 of file connection_table.cpp.
References AUTO_LOCK, connection::liveness, and unique_id< uniquifier >::raw_id().
| bool connection_table::set_liveness | ( | const connection_id & | conn_id, | |
| const heartbeat & | new_liveness | |||
| ) |
Definition at line 165 of file connection_table.cpp.
References AUTO_LOCK, connection::liveness, and unique_id< uniquifier >::raw_id().
| void connection_table::show_connections | ( | istring & | output, | |
| int | indentation = 0, |
|||
| bool | alive_only = false | |||
| ) |
Definition at line 407 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, string_manipulation::indentation(), log_base::platform_ending(), and connection::text_form().
| int connection_table::connections | ( | ) | const |
| connection::states connection_table::get_conn_state | ( | const transport_id & | tran_id | ) |
Definition at line 463 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::DISCONNECTED, find_linked(), FUNCDEF, LOCAL_LINK, unique_id< uniquifier >::raw_id(), and connection::state().
| bool connection_table::set_conn_state | ( | const transport_id & | tran_id, | |
| connection::states | state | |||
| ) |
Definition at line 426 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::DISCONNECTED, find_linked(), FUNCDEF, LOCAL_LINK, connection::low_level, PRIMARY_ID, unique_id< uniquifier >::raw_id(), and connection::state().
| int connection_table::set_conn_states | ( | const transport_id & | real_id, | |
| connection::states | state | |||
| ) |
Definition at line 446 of file connection_table.cpp.
References AUTO_LOCK, FUNCDEF, connection::real_transport_id, and connection::state().
| bool connection_table::owns_connection | ( | const connection_id & | conn_id, | |
| const transport_id & | link_id | |||
| ) |
Definition at line 266 of file connection_table.cpp.
References AUTO_LOCK, find(), FUNCDEF, connection::local_transport_id, and unique_id< uniquifier >::raw_id().
| int connection_table::connections_on_primary | ( | const transport_id & | real_id, | |
| const transport_id & | ignored_link_id, | |||
| int | primary_id | |||
| ) |
| void connection_table::complain_missing_connection | ( | const connection_id & | conn_id, | |
| const istring & | where | |||
| ) | const |
Definition at line 73 of file connection_table.cpp.
References EMERGENCY_LOG, program_wide_logger(), unique_id< uniquifier >::raw_id(), istring::SPRINTF, and timestamp().
Referenced by update().
| int_set connection_table::find_related_conns | ( | int | low_level_primary, | |
| int | real_transport | |||
| ) |
Definition at line 510 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, FUNCDEF, connection::low_level, PRIMARY_ID, and connection::real_transport_id.
| int_set connection_table::find_live_reals | ( | ) |
Definition at line 528 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, FUNCDEF, unique_id< uniquifier >::raw_id(), and connection::real_transport_id.
| connection_id connection_table::find_dupe | ( | int | real_transport, | |
| int | low_level_primary, | |||
| const network_address & | sender, | |||
| int | other_side_transport | |||
| ) |
Definition at line 541 of file connection_table.cpp.
References connection::alive, AUTO_LOCK, connection::conn_id(), FUNCDEF, connection::low_level, PRIMARY_ID, connection::real_transport_id, connection::remote_host, and connection::remote_transport_id.
1.5.1