class

RNS::Discovery::InterfaceDiscovery

Inherits Reference < Object

═══════════════════════════════════════════════════════════════════ InterfaceDiscovery — coordinates discovery, persistence, autoconnect ═══════════════════════════════════════════════════════════════════

Constants

AUTOCONNECT_TYPES = ["BackboneInterface", "TCPServerInterface"]
DETACH_THRESHOLD = 12
MONITOR_INTERVAL = 5
STATUS_AVAILABLE = 1000
STATUS_CODE_MAP = {"available" => STATUS_AVAILABLE, "unknown" => STATUS_UNKNOWN, "stale" => STATUS_STALE}
STATUS_STALE = 0
STATUS_UNKNOWN = 100
THRESHOLD_REMOVE = ((7 * 24) * 60) * 60
THRESHOLD_STALE = ((3 * 24) * 60) * 60
THRESHOLD_UNKNOWN = (24 * 60) * 60

Constructors

new(required_value : Int32 = InterfaceAnnouncer::DEFAULT_STAMP_VALUE, discovery_callback : Proc(InfoHash, Nil) | Nil = nil, discover_interfaces : Bool = true)
Source

Instance methods

autoconnect(info : InfoHash)
Source
autoconnect_count
Source
bootstrap_interface_count
Source
connect_discovered
Source
detach_threshold
Source
detach_threshold=(detach_threshold : Int32)
Source
discovery_callback
Source
discovery_callback=(discovery_callback : Proc(InfoHash, Nil) | Nil)
Source
endpoint_hash(info : InfoHash) : Bytes
Source
handler
Source
initial_autoconnect_ran
Source
initial_autoconnect_ran=(initial_autoconnect_ran : Bool)
Source
interface_discovered(info : InfoHash)
Source
interface_exists?(info : InfoHash) : Bool
Source
list_discovered_interfaces(only_available : Bool = false, only_transport : Bool = false) : Array(InfoHash)
Source
monitor_interface(interface : Interface)
Source
monitor_interval
Source
monitor_interval=(monitor_interval : Int32)
Source
monitored_interfaces
Source
monitored_interfaces=(monitored_interfaces : Array(Interface))
Source
monitoring_autoconnects
Source
monitoring_autoconnects=(monitoring_autoconnects : Bool)
Source
required_value
Source
required_value=(required_value : Int32)
Source
storagepath
Source
storagepath=(storagepath : String)
Source
teardown_interface(interface : Interface)
Source

Nested types