RNS::I2PInterfacePeer
Inherits RNS::Interface < Reference < Object
Constants
I2P_PROBE_AFTER = 10
I2P_PROBE_INTERVAL = 9
I2P_PROBES = 5
I2P_READ_TIMEOUT = ((I2P_PROBE_INTERVAL * I2P_PROBES) + I2P_PROBE_AFTER) * 2
I2P_USER_TIMEOUT = 45
I2P TCP socket timeouts (matching Python I2PInterfacePeer constants)
RECONNECT_MAX_TRIES = nil
RECONNECT_WAIT = 15
TUNNEL_STATE_ACTIVE = 1_u8
TUNNEL_STATE_INIT = 0_u8
TUNNEL_STATE_STALE = 2_u8
Constructors
new(parent_interface : Interface, owner_callback : Proc(Bytes, Interface, Nil) | Nil, name : String, connected_socket : TCPSocket, max_reconnect_tries : Int32 | Nil = nil)
Constructor for server-spawned peer (connected_socket provided)
Instance methods
awaiting_i2p_tunnel
Sourcedir_in
Sourcedir_out
Sourcei2p_dest
Sourcei2p_tunnel_ready
Sourcei2p_tunnel_state
Sourcei2p_tunneled
Sourceinitiator
Sourcekiss_framing
Sourcelast_read
Sourcelast_write
Sourcemax_reconnect_tries
Sourcenever_connected
Sourceparent_count
Sourceprocess_outgoing(data : Bytes)
Send data out through the interface. Subclasses must implement this.
read_watchdog
Sourcereconnect
Sourcereconnecting
Sourceshutdown_socket
Sourcesocket
Sourcestart_read_loop
Sourceteardown
Tear down the interface, releasing any resources (sockets, fibers, etc.). Subclasses should override to close their specific resources.
to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
wants_tunnel
Sourcewd_reset
Sourcewriting
Source