Class: Fluent::RawTcpOutput::Node
- Inherits:
-
Object
- Object
- Fluent::RawTcpOutput::Node
- Defined in:
- lib/fluent/plugin/out_rawtcp.rb
Instance Attribute Summary collapse
-
#available ⇒ Object
Returns the value of attribute available.
-
#conf ⇒ Object
readonly
Returns the value of attribute conf.
-
#failure ⇒ Object
Returns the value of attribute failure.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #available? ⇒ Boolean
-
#initialize(log, conf) ⇒ Node
constructor
A new instance of Node.
- #resolved_host ⇒ Object
- #standby? ⇒ Boolean
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
#available ⇒ Object
Returns the value of attribute available.
108 109 110 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 108 def available @available end |
#conf ⇒ Object (readonly)
Returns the value of attribute conf.
106 107 108 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 106 def conf @conf end |
#failure ⇒ Object
Returns the value of attribute failure.
108 109 110 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 108 def failure @failure end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
107 108 109 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 107 def host @host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
107 108 109 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 107 def name @name end |
#port ⇒ Object (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
110 111 112 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 110 def available? @available end |
#resolved_host ⇒ Object
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
114 115 116 |
# File 'lib/fluent/plugin/out_rawtcp.rb', line 114 def standby? @conf.standby end |