lib/potato/irc/client.rb in potato-0.0.13 vs lib/potato/irc/client.rb in potato-0.0.14
- old
+ new
@@ -354,10 +354,14 @@
def send_packet opts = {}
opts = ({:colon => true, :cmd => "", :args => [], :content => nil}).merge(opts)
str = opts[:colon] ? ":" : ""
str << opts[:cmd] << " " << Array(opts[:args]).join(" ")
str << " :#{opts[:content]}" if opts[:content]
- @socket.write(str + "\r\n")
+ begin
+ @socket.write(str + "\r\n")
+ rescue Errno::ETIMEDOUT
+ close
+ end
debug str
end
def close
@client.quit
\ No newline at end of file