From 044b659e50c0c3f90f1de2b48a482a48b0668918 Mon Sep 17 00:00:00 2001 From: Chris Gahan Date: Thu, 1 Jun 2006 06:13:29 +0000 Subject: [PATCH] giuseppe.bilotta's patch: "Fix exception when connection with server times out" --- lib/rbot/ircsocket.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index 7ceba21b..df1f4e8a 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -100,11 +100,15 @@ module Irc # get the next line from the server (blocks) def gets - reply = @sock.gets - @lines_received += 1 - reply.strip! if reply - debug "RECV: #{reply.inspect}" - reply + begin + reply = @sock.gets + @lines_received += 1 + reply.strip! if reply + debug "RECV: #{reply.inspect}" + return reply + rescue + return nil + end end def queue(msg) -- 2.39.5