【发布时间】:2014-03-02 02:33:55
【问题描述】:
如果发现任何错误或未连接状态,有什么方法可以重新连接到 Pusher?
这是我们的连接代码:
var pusher = new Pusher('<apikey>', {encrypted: true});
var state = pusher.connection.state;
pusher.connection.bind( 'error', function( err ) {
console.log(err);
});
pusher.connection.bind('state_change', function(states) {
// states = {previous: 'oldState', current: 'newState'}
console.log(states);
});
【问题讨论】:
标签: connection state pusher reconnect