Class: Fluent::PluginHelper::Server::TCPCallbackSocket

Inherits:
CallbackSocket
  • Object
show all
Defined in:
lib/fluent/plugin_helper/server.rb

Constant Summary collapse

ENABLED_EVENTS =
[:data, :write_complete, :close]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CallbackSocket

#close, #close_after_write_complete, #data, #on, #remote_addr, #remote_host, #remote_port, #send

Constructor Details

#initialize(sock) ⇒ TCPCallbackSocket

Returns a new instance of TCPCallbackSocket.



477
478
479
480
481
# File 'lib/fluent/plugin_helper/server.rb', line 477

def initialize(sock)
  super("tcp", sock, ENABLED_EVENTS)
  @peeraddr = (@sock.peeraddr rescue PEERADDR_FAILED)
  @buffer = ''
end

Instance Attribute Details

#bufferObject

Returns the value of attribute buffer.



475
476
477
# File 'lib/fluent/plugin_helper/server.rb', line 475

def buffer
  @buffer
end

Instance Method Details

#write(data) ⇒ Object



483
484
485
# File 'lib/fluent/plugin_helper/server.rb', line 483

def write(data)
  @sock.write(data)
end