- report the host/port that is related to EADDRINUSE (LOGSTASH-831)

This commit is contained in:
Jordan Sissel 2013-01-09 23:40:42 -08:00
parent 2d43825aea
commit 3761978c14

View file

@ -42,7 +42,13 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
def register
if server?
@logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}")
@server_socket = TCPServer.new(@host, @port)
begin
@server_socket = TCPServer.new(@host, @port)
rescue Errno::EADDRINUSE
@logger.error("Could not start TCP server: Address in use",
:host => @host, :port => @port)
raise
end
end
end # def register