Class: Fluent::TcpInput

Inherits:
SocketUtil::BaseInput
  • Object
show all
Defined in:
lib/fluent/plugin/in_tcp.rb

Instance Method Summary collapse

Instance Method Details

#listen(callback) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fluent/plugin/in_tcp.rb', line 29

def listen(callback)
  log.info "listening tcp socket on #{@bind}:#{@port}"

  socket_manager_path = ENV['SERVERENGINE_SOCKETMANAGER_PATH']
  if Fluent.windows?
    socket_manager_path = socket_manager_path.to_i
  end
  client = ServerEngine::SocketManager::Client.new(socket_manager_path)
  lsock = client.listen_tcp(@bind, @port)
  Coolio::TCPServer.new(lsock, nil, SocketUtil::TcpHandler, log, @delimiter, callback)
end