socket.io-rails 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/socket.io-rails/version.rb +1 -1
- data/vendor/assets/javascripts/socket.io.js +25 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae004a0e89d45dcf2aab359f03c9371f722ac8ea
|
4
|
+
data.tar.gz: 9caad930a2db41dbd687fdebf23d58758dee98b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7589d32f8ad710d3cd080054f396ea949a7d08e09055c95218e48e700881261ea7a15b75498295fe9fab7935c061c26de84c4c06583c44f9be31eb1b5d3753de
|
7
|
+
data.tar.gz: 78d7ffb75cb350a3b398e258ede2a457aef1d669a285e9fd5cb63351945f8dad964e1ec6d261a23ec550019f597809027967dc46e93cb8c185154b5237805956
|
@@ -514,7 +514,7 @@ Manager.prototype.reconnect = function(){
|
|
514
514
|
this.reconnecting = true;
|
515
515
|
var timer = setTimeout(function(){
|
516
516
|
debug('attempting reconnect');
|
517
|
-
self.emitAll('reconnect_attempt');
|
517
|
+
self.emitAll('reconnect_attempt', self.attempts);
|
518
518
|
self.emitAll('reconnecting', self.attempts);
|
519
519
|
self.open(function(err){
|
520
520
|
if (err) {
|
@@ -640,6 +640,7 @@ function Socket(io, nsp){
|
|
640
640
|
this.sendBuffer = [];
|
641
641
|
this.connected = false;
|
642
642
|
this.disconnected = true;
|
643
|
+
this.subEvents();
|
643
644
|
}
|
644
645
|
|
645
646
|
/**
|
@@ -649,21 +650,31 @@ function Socket(io, nsp){
|
|
649
650
|
Emitter(Socket.prototype);
|
650
651
|
|
651
652
|
/**
|
652
|
-
*
|
653
|
+
* Subscribe to open, close and packet events
|
653
654
|
*
|
654
655
|
* @api private
|
655
656
|
*/
|
656
657
|
|
657
|
-
Socket.prototype.
|
658
|
-
Socket.prototype.connect = function(){
|
659
|
-
if (this.connected) return this;
|
658
|
+
Socket.prototype.subEvents = function() {
|
660
659
|
var io = this.io;
|
661
|
-
io.open(); // ensure open
|
662
660
|
this.subs = [
|
663
661
|
on(io, 'open', bind(this, 'onopen')),
|
664
662
|
on(io, 'packet', bind(this, 'onpacket')),
|
665
663
|
on(io, 'close', bind(this, 'onclose'))
|
666
664
|
];
|
665
|
+
};
|
666
|
+
|
667
|
+
/**
|
668
|
+
* Called upon engine `open`.
|
669
|
+
*
|
670
|
+
* @api private
|
671
|
+
*/
|
672
|
+
|
673
|
+
Socket.prototype.open =
|
674
|
+
Socket.prototype.connect = function(){
|
675
|
+
if (this.connected) return this;
|
676
|
+
|
677
|
+
this.io.open(); // ensure open
|
667
678
|
if ('open' == this.io.readyState) this.onopen();
|
668
679
|
return this;
|
669
680
|
};
|
@@ -2284,8 +2295,14 @@ Transport.prototype.onOpen = function () {
|
|
2284
2295
|
* @api private
|
2285
2296
|
*/
|
2286
2297
|
|
2287
|
-
Transport.prototype.onData = function
|
2288
|
-
|
2298
|
+
Transport.prototype.onData = function(data){
|
2299
|
+
try {
|
2300
|
+
var packet = parser.decodePacket(data, this.socket.binaryType);
|
2301
|
+
this.onPacket(packet);
|
2302
|
+
} catch(e){
|
2303
|
+
e.data = data;
|
2304
|
+
this.onError('parser decode error', e);
|
2305
|
+
}
|
2289
2306
|
};
|
2290
2307
|
|
2291
2308
|
/**
|