class

RNS::LocalClientInterface

Inherits RNS::Interface < Reference < Object

Constants

AUTOCONFIGURE_MTU = true
HW_MTU_DEFAULT = 262144
RECONNECT_WAIT = 8

Constructors

new(target_port : Int32 | Nil = nil, socket_path : String | Nil = nil, name : String = "", inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)

Constructor for initiator client — connects to shared instance via TCP or Unix socket

Source
new(connected_socket : Socket, name : String = "", inbound_callback : Proc(Bytes, Interface, Nil) | Nil = nil)

Constructor for server-spawned client — wraps an already-connected socket

Source

Instance methods

connect
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
force_bitrate
Source
force_bitrate=(force_bitrate : Bool)
Source
inbound_callback=(cb : Proc(Bytes, Interface, Nil) | Nil)
Source
is_connected_to_shared_instance
Source
is_connected_to_shared_instance=(is_connected_to_shared_instance : 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
should_ingress_limit?

Determine when an interface should activate ingress limiting. Subclasses may override for different behavior.

Source
socket_path
Source
socket_path=(path : String | Nil)
Source
target_ip
Source
target_ip=(ip : String | Nil)
Source
target_port
Source
target_port=(port : Int32 | Nil)
Source
teardown(nowarning : Bool = false)

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