Method: OpenC3::TcpipClientInterface#initialize

Defined in:
lib/openc3/interfaces/tcpip_client_interface.rb

#initialize(hostname, write_port, read_port, write_timeout, read_timeout, protocol_type = nil, *protocol_args) ⇒ TcpipClientInterface

Returns a new instance of TcpipClientInterface.

Parameters:

  • hostname (String)

    Machine to connect to

  • write_port (Integer)

    Port to write commands to

  • read_port (Integer)

    Port to read telemetry from

  • write_timeout (Float)

    Seconds to wait before aborting writes

  • read_timeout (Float|nil)

    Seconds to wait before aborting reads. Pass nil to block until the read is complete.

  • protocol_type (String) (defaults to: nil)

    Name of the protocol to use with this interface

  • protocol_args (Array<String>)

    Arguments to pass to the protocol



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/openc3/interfaces/tcpip_client_interface.rb', line 38

def initialize(
  hostname,
  write_port,
  read_port,
  write_timeout,
  read_timeout,
  protocol_type = nil,
  *protocol_args
)

  super(protocol_type, protocol_args)

  @hostname = hostname
  @write_port = ConfigParser.handle_nil(write_port)
  @read_port = ConfigParser.handle_nil(read_port)
  @write_timeout = write_timeout
  @read_timeout = read_timeout
  @read_allowed = false unless @read_port
  @write_allowed = false unless @write_port
  @write_raw_allowed = false unless @write_port
end