mcuadros / go-syslog

Syslog server library for go.
http://godoc.org/gopkg.in/mcuadros/go-syslog.v2
MIT License
523 stars 143 forks source link

Add support for TCP connection timeout and to terminate on Kill() #4

Closed isaldana closed 10 years ago

isaldana commented 10 years ago

When a client maintains a TCP connection open, the server is not able to terminate since it waits for the client to disconnect. This adds support for a timeout on idle connections. Also support was added to terminate right after a successful read if Kill() is called.

I initially setup rsyslog to relay logs to this server using TCP. rsyslog maintains a connection open for a long time so this server was never able to exit. A good timeout setting is about 15 seconds.

mcuadros commented 10 years ago

Thanks!