Class: Fluent::PluginHelper::Server::UDPCallbackSocket
Constant Summary
collapse
- ENABLED_EVENTS =
[]
Instance Method Summary
collapse
#close, #close_after_write_complete, #data, #on, #send
Constructor Details
#initialize(sock, peeraddr, **kwargs) ⇒ UDPCallbackSocket
Returns a new instance of UDPCallbackSocket.
495
496
497
498
|
# File 'lib/fluent/plugin_helper/server.rb', line 495
def initialize(sock, peeraddr, **kwargs)
super("udp", sock, ENABLED_EVENTS, **kwargs)
@peeraddr = peeraddr
end
|
Instance Method Details
#remote_addr ⇒ Object
500
501
502
|
# File 'lib/fluent/plugin_helper/server.rb', line 500
def remote_addr
@peeraddr[3]
end
|
#remote_host ⇒ Object
504
505
506
|
# File 'lib/fluent/plugin_helper/server.rb', line 504
def remote_host
@peeraddr[2]
end
|
#remote_port ⇒ Object
508
509
510
|
# File 'lib/fluent/plugin_helper/server.rb', line 508
def remote_port
@peeraddr[1]
end
|
#write(data) ⇒ Object
512
513
514
|
# File 'lib/fluent/plugin_helper/server.rb', line 512
def write(data)
@sock.send(data, 0, @peeraddr[3], @peeraddr[1])
end
|