lib/slack/real_time/concurrency/celluloid.rb in slack-ruby-client-0.11.1 vs lib/slack/real_time/concurrency/celluloid.rb in slack-ruby-client-0.12.0

- old
+ new

@@ -32,17 +32,17 @@ @closing = false @socket = build_socket @connected = @socket.connect driver.start loop { read } if socket - rescue EOFError, Errno::EPIPE => e + rescue EOFError, Errno::ECONNRESET, Errno::EPIPE => e logger.debug("#{self.class}##{__method__}") { e } driver.emit(:close, WebSocket::Driver::CloseEvent.new(1001, 'server closed connection')) unless @closing ensure begin current_actor.terminate if current_actor.alive? - rescue + rescue StandardError nil end end def close @@ -51,9 +51,10 @@ super end def read buffer = socket.readpartial(BLOCK_SIZE) + raise EOFError unless buffer && !buffer.empty? async.handle_read(buffer) end def handle_read(buffer) logger.debug("#{self.class}##{__method__}") { buffer }