diff --git a/lib/nsq/connection.rb b/lib/nsq/connection.rb index 49f72a9..901f88e 100644 --- a/lib/nsq/connection.rb +++ b/lib/nsq/connection.rb @@ -170,7 +170,7 @@ def write_to_socket(raw) debug ">>> #{raw.inspect}" begin @socket.write_nonblock(raw) - rescue Errno::EWOULDBLOCK + rescue Errno::EWOULDBLOCK, OpenSSL::SSL::SSLErrorWaitWritable if connected? sleep 0.01 retry @@ -235,7 +235,7 @@ def receive_frame(max_receive_time = nil) data = @socket.read_nonblock(size) frame_class = frame_class_for_type(type) return frame_class.new(data, self) - rescue Errno::EWOULDBLOCK + rescue Errno::EWOULDBLOCK, OpenSSL::SSL::SSLErrorWaitReadable if break_after.nil? || break_after > Time.now sleep 0.01 retry @@ -244,7 +244,7 @@ def receive_frame(max_receive_time = nil) end end end - rescue Errno::EWOULDBLOCK + rescue Errno::EWOULDBLOCK, OpenSSL::SSL::SSLErrorWaitReadable if break_after.nil? || break_after > Time.now sleep 0.01 retry