Class: Fluent::RawTcpOutput::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_rawtcp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log, conf) ⇒ Node

Returns a new instance of Node.



97
98
99
100
101
102
103
104
# File 'lib/fluent/plugin/out_rawtcp.rb', line 97

def initialize(log, conf)
  @log = log
  @conf = conf
  @name = @conf.name
  @host = @conf.host
  @port = @conf.port
  resolved_host  # check dns
end

Instance Attribute Details

#availableObject

Returns the value of attribute available.



108
109
110
# File 'lib/fluent/plugin/out_rawtcp.rb', line 108

def available
  @available
end

#confObject (readonly)

Returns the value of attribute conf.



106
107
108
# File 'lib/fluent/plugin/out_rawtcp.rb', line 106

def conf
  @conf
end

#failureObject

Returns the value of attribute failure.



108
109
110
# File 'lib/fluent/plugin/out_rawtcp.rb', line 108

def failure
  @failure
end

#hostObject (readonly)

Returns the value of attribute host.



107
108
109
# File 'lib/fluent/plugin/out_rawtcp.rb', line 107

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



107
108
109
# File 'lib/fluent/plugin/out_rawtcp.rb', line 107

def name
  @name
end

#portObject (readonly)

Returns the value of attribute port.



107
108
109
# File 'lib/fluent/plugin/out_rawtcp.rb', line 107

def port
  @port
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/fluent/plugin/out_rawtcp.rb', line 110

def available?
  @available
end

#resolved_hostObject



118
119
120
121
122
# File 'lib/fluent/plugin/out_rawtcp.rb', line 118

def resolved_host
  @sockaddr = Socket.pack_sockaddr_in(@port, @host)
  port, rhost = Socket.unpack_sockaddr_in(@sockaddr)
  return rhost
end

#standby?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/fluent/plugin/out_rawtcp.rb', line 114

def standby?
  @conf.standby
end