我得到" 文件结尾"使用pusher-websocket-ruby gem连接几个小时(3-4小时)后出现无限循环错误。我也听推送:错误事件,但它没有抓到任何东西。此错误后,订阅频道的连接也会丢失。有人面对这个问题吗?任何想法如何防止无限循环和连接丢失?
我的宝石版本是0.15.1 https://github.com/pusher-community/pusher-websocket-ruby
require 'pusher-client'
options = {:secret => 'secret_key'}
socket = PusherClient::Socket.new("key",options)
socket.connect(true) # Connect asynchronously
socket.subscribe('socket_name')
socket.bind('pusher:error') do |data|
PusherClient.logger.fatal("Pusher : error : #{data.inspect}")
end
socket['socket_name'].bind("test") do |data|
#my business
end
loop do
sleep(1)
end
修改
错误日志
D, [2014-10-18T06:42:46.705047 #9564] DEBUG -- : end of file reached
D, [2014-10-18T06:42:46.705102 #9564] DEBUG -- : end of file reached
D, [2014-10-18T06:42:46.705158 #9564] DEBUG -- : end of file reached