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.



446
447
448
449
450
# File 'lib/fluent/plugin_helper/server.rb', line 446

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.



444
445
446
# File 'lib/fluent/plugin_helper/server.rb', line 444

def buffer
  @buffer
end

Instance Method Details

#write(data) ⇒ Object



452
453
454
# File 'lib/fluent/plugin_helper/server.rb', line 452

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