X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircsocket.rb;h=7ceba21b91858664c4b2644ccced8c0f7f97f625;hb=5a06676cdec9d4b43767f39ef2dea3b735a964a5;hp=af605e371962eedd69bfd19480751d2153d8d875;hpb=70b4d72c18d092bf14c982a28e860321f947755c;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index af605e37..7ceba21b 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -31,6 +31,7 @@ module Irc @server = server.dup @port = port.to_i @host = host + @sock = nil @spooler = false @lines_sent = 0 @lines_received = 0 @@ -50,6 +51,7 @@ module Irc # open a TCP connection to the server def connect + @sock = nil if(@host) begin @sock=TCPSocket.new(@server, @port, @host) @@ -165,7 +167,8 @@ module Irc # shutdown the connection to the server def shutdown(how=2) - @sock.shutdown(how) + @sock.shutdown(how) unless @sock.nil? + @sock = nil end private