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.



465
466
467
468
469
# File 'lib/fluent/plugin_helper/server.rb', line 465

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.



463
464
465
# File 'lib/fluent/plugin_helper/server.rb', line 463

def buffer
  @buffer
end

Instance Method Details

#write(data) ⇒ Object



471
472
473
# File 'lib/fluent/plugin_helper/server.rb', line 471

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