class EthernetConnection

Attributes

connectiontimeout[R]
host[R]
port[R]
portname[R]
timeout[R]

Public Class Methods

new(args) click to toggle source
# File lib/ethernet_connection.rb, line 3
def initialize(args)
  @portname          = 'TCP/IP'
  @host              = args[:host]
  @port              = args[:port]              || default_port
  @connectiontimeout = args[:connectiontimeout] || default_connectiontimeout
  @timeout           = args[:timeout]           || default_timeout
end

Public Instance Methods

port_config_string() click to toggle source
# File lib/ethernet_connection.rb, line 11
def port_config_string  
  "PortName=#{portname};Host=#{host};Port=#{port};ConnectionTimeout=#{connectiontimeout};Timeout=timeout"
end

Private Instance Methods

default_connectiontimeout() click to toggle source
# File lib/ethernet_connection.rb, line 20
def default_connectiontimeout
  10000
end
default_port() click to toggle source
# File lib/ethernet_connection.rb, line 16
def default_port
  6001
end
default_timeout() click to toggle source
# File lib/ethernet_connection.rb, line 24
def default_timeout
  30000
end