class

RNS::TCPClientInterface

Inherits RNS::Interface < Reference < Object

Constants

AUTOCONFIGURE_MTU = true
BITRATE_GUESS = 10000000_i64
DEFAULT_IFAC_SIZE = 16
I2P_PROBE_AFTER = 10
I2P_PROBE_INTERVAL = 9
I2P_PROBES = 5
I2P_USER_TIMEOUT = 45
INITIAL_CONNECT_TIMEOUT = 5
RECONNECT_MAX_TRIES = nil
RECONNECT_WAIT = 5
SYNCHRONOUS_START = true
TCP_PROBE_AFTER = 5
TCP_PROBE_INTERVAL = 2
TCP_PROBES = 12
TCP_USER_TIMEOUT = 24

Constructors

new(configuration : Hash(String, String), inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)
Source
new(connected_socket : TCPSocket, name : String = "", kiss_framing : Bool = false, i2p_tunneled : Bool = false, inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)
Source

Instance methods

connect(initial : Bool = false) : Bool
Source
detach

Called when the interface is being detached/removed

Source
dir_in
Source
dir_in=(dir_in : Bool)
Source
dir_out
Source
dir_out=(dir_out : Bool)
Source
i2p_tunneled
Source
i2p_tunneled=(i2p_tunneled : Bool)
Source
inbound_callback=(cb : Proc(Bytes, Interface, Nil) | Nil)
Source
initiator?
Source
kiss_framing
Source
kiss_framing=(kiss_framing : Bool)
Source
never_connected
Source
never_connected=(never_connected : Bool)
Source
process_incoming(data : Bytes)
Source
process_outgoing(data : Bytes)

Send data out through the interface. Subclasses must implement this.

Source
receives?
Source
reconnect
Source
reconnecting
Source
reconnecting=(reconnecting : Bool)
Source
start_read_loop
Source
target_ip
Source
target_ip=(ip : String | Nil)
Source
target_port
Source
target_port=(port : Int32 | Nil)
Source
teardown

Tear down the interface, releasing any resources (sockets, fibers, etc.). Subclasses should override to close their specific resources.

Source
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>
Source
wants_tunnel
Source
wants_tunnel=(wants_tunnel : Bool)
Source
writing
Source
writing=(writing : Bool)
Source