Class: Datadog::Statsd::UDPConnection
- Inherits:
-
Connection
- Object
- Connection
- Datadog::Statsd::UDPConnection
- Defined in:
- lib/datadog/statsd/udp_connection.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
StatsD host.
-
#port ⇒ Object
readonly
StatsD port.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(host, port, **kwargs) ⇒ UDPConnection
constructor
A new instance of UDPConnection.
Methods inherited from Connection
Constructor Details
#initialize(host, port, **kwargs) ⇒ UDPConnection
Returns a new instance of UDPConnection.
14 15 16 17 18 19 20 |
# File 'lib/datadog/statsd/udp_connection.rb', line 14 def initialize(host, port, **kwargs) super(**kwargs) @host = host @port = port @socket = nil end |
Instance Attribute Details
#host ⇒ Object (readonly)
StatsD host.
9 10 11 |
# File 'lib/datadog/statsd/udp_connection.rb', line 9 def host @host end |
#port ⇒ Object (readonly)
StatsD port.
12 13 14 |
# File 'lib/datadog/statsd/udp_connection.rb', line 12 def port @port end |
Instance Method Details
#close ⇒ Object
22 23 24 25 |
# File 'lib/datadog/statsd/udp_connection.rb', line 22 def close @socket.close if @socket @socket = nil end |