Skip to content

Commit

Permalink
fixing for tls connections
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrumm authored and chen-anders committed Dec 3, 2023
1 parent b852b57 commit e2d5166
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/nsq/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e2d5166

Please sign in to comment.