Class: Fluent::UdpHandler
- Inherits:
-
SocketUtil::UdpHandler
- Object
- SocketUtil::UdpHandler
- Fluent::UdpHandler
- Defined in:
- lib/fluent/plugin/in_gelf.rb
Instance Method Summary collapse
-
#initialize(io, log, body_size_limit, callback) ⇒ UdpHandler
constructor
A new instance of UdpHandler.
- #on_readable ⇒ Object
Constructor Details
#initialize(io, log, body_size_limit, callback) ⇒ UdpHandler
Returns a new instance of UdpHandler.
14 15 16 |
# File 'lib/fluent/plugin/in_gelf.rb', line 14 def initialize(io, log, body_size_limit, callback) super end |
Instance Method Details
#on_readable ⇒ Object
17 18 19 20 21 22 |
# File 'lib/fluent/plugin/in_gelf.rb', line 17 def on_readable msg, addr = @io.recvfrom_nonblock(@body_size_limit) @callback.call(msg, addr) rescue => e @log.error "unexpected error", error: e, error_class: e.class end |