I found the following in the pusher documentation and also found that the library is not handling the same.
Connection closure
Clients may close the WebSocket connection at any time.
The Pusher server may choose to close the WebSocket connection, in which case a close code and reason will be sent.
Clients SHOULD support the following 3 ranges
- 4000-4099: The connection SHOULD NOT be re-established unchanged.
- 4100-4199: The connection SHOULD be re-established after backing off. The back-off time SHOULD be at least 1 second in duration and MAY be exponential in nature on consecutive failures.
- 4200-4299: The connection SHOULD be re-established immediately.
The following is how it is handled in the library:
bind('pusher:error') do |data|
PusherClient.logger.fatal("Pusher : error : #{data.inspect}")
end
This is resulting in infinite loop that logs "end of file reached", when pusher closes the connection with the error code 4200.
I found the following in the pusher documentation and also found that the library is not handling the same.
Connection closure
Clients may close the WebSocket connection at any time.
The Pusher server may choose to close the WebSocket connection, in which case a close code and reason will be sent.
Clients SHOULD support the following 3 ranges
The following is how it is handled in the library:
This is resulting in infinite loop that logs "end of file reached", when pusher closes the connection with the error code 4200.