diff --git a/lib/server.rb b/lib/server.rb index f2b2c25..0a92334 100644 --- a/lib/server.rb +++ b/lib/server.rb @@ -15,12 +15,14 @@ def start while socket = @unix_server.accept do client = Client.new @bridge, socket Thread.new do + IRCNotify.log "Adding client #{client}" @mutex.synchronize { @clients << client } begin client.start_read - rescue StandardError => error + rescue => error IRCNotify.log "Client error: #{error}", :error end + IRCNotify.log "Removing client #{client}" @mutex.synchronize { @clients.delete client } end end