mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 07:58:13 -05:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a91c6f26f4 | ||
|
|
aa9f2596cb | ||
|
|
e2a97588ef | ||
|
|
0b904d79c2 | ||
|
|
f99ac54df5 | ||
|
|
b306cc77d7 | ||
|
|
ba70be4e0b | ||
|
|
0b17ec9cb8 | ||
|
|
71e77561bb | ||
|
|
f5b2028577 | ||
|
|
7f08d8fd59 | ||
|
|
ffb0574a76 | ||
|
|
e57e27ee43 |
32
History.md
32
History.md
@@ -1,4 +1,36 @@
|
||||
|
||||
0.6.8 / 2011-01-10
|
||||
==================
|
||||
|
||||
* Fixed issue with terminating connection twice
|
||||
|
||||
0.6.7 / 2011-01-09
|
||||
==================
|
||||
|
||||
* Fixed situation where the connection drops but the client can still autoreconnect
|
||||
through a different socket. In this case we still want to clear the FD but not
|
||||
call onDisconnect immediately.
|
||||
|
||||
0.6.6 / 2011-01-09
|
||||
==================
|
||||
|
||||
* Note for Flash socket and inline policy on Firefox
|
||||
* Destroy the fds on disconnect
|
||||
* Restored 20 secs of polling so that node doesn't timeout the connections
|
||||
|
||||
0.6.5 / 2011-01-09
|
||||
==================
|
||||
|
||||
* Make sure not to trigger multiple timeouts when closing
|
||||
* Important fix for polling transports.
|
||||
|
||||
0.6.4 / 2011-01-05
|
||||
==================
|
||||
|
||||
* Don't destroy the connection in _onClose. Destroying it will prevent the buffers from being flushed and will result in corrupted responses for the xhr-polling transport.
|
||||
* Added try/catch block around JSON.parse and return an empty object literal if JSON parsing fails.
|
||||
* Added missing .connect() to example
|
||||
|
||||
0.6.3 / 2010-12-23
|
||||
==================
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ On the client:
|
||||
<script src="/socket.io/socket.io.js"></script>
|
||||
<script>
|
||||
var socket = new io.Socket();
|
||||
socket.connect();
|
||||
socket.on('connect', function(){ … })
|
||||
socket.on('message', function(){ … })
|
||||
socket.on('disconnect', function(){ … })
|
||||
|
||||
@@ -48,7 +48,11 @@ Client.prototype._onMessage = function(data){
|
||||
case '~h~':
|
||||
return this._onHeartbeat(messages[i].substr(3));
|
||||
case '~j~':
|
||||
messages[i] = JSON.parse(messages[i].substr(3));
|
||||
try {
|
||||
messages[i] = JSON.parse(messages[i].substr(3));
|
||||
} catch(e) {
|
||||
messages[i] = {};
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.emit('message', messages[i]);
|
||||
@@ -62,9 +66,11 @@ Client.prototype._onConnect = function(req, res){
|
||||
this.request = req;
|
||||
this.response = res;
|
||||
this.connection = req.connection;
|
||||
|
||||
|
||||
this.connection.addListener('end', function(){
|
||||
self._onClose();
|
||||
if (self.connection)
|
||||
self.connection.destroy();
|
||||
});
|
||||
|
||||
if (req){
|
||||
@@ -121,15 +127,11 @@ Client.prototype._onHeartbeat = function(h){
|
||||
};
|
||||
|
||||
Client.prototype._onClose = function(skipDisconnect){
|
||||
if (!this._open) return this;
|
||||
var self = this;
|
||||
if (this._heartbeatInterval) clearTimeout(this._heartbeatInterval);
|
||||
if (this._heartbeatTimeout) clearTimeout(this._heartbeatTimeout);
|
||||
this._open = false;
|
||||
if (this.connection){
|
||||
this.connection.end();
|
||||
this.connection.destroy();
|
||||
this.connection = null;
|
||||
}
|
||||
this.request = null;
|
||||
this.response = null;
|
||||
if (skipDisconnect !== false){
|
||||
|
||||
@@ -42,10 +42,11 @@ Flashsocket.init = function(listener){
|
||||
netserver.listen(843);
|
||||
} catch(e){
|
||||
if (e.errno == 13)
|
||||
listener.options.log('Your node instance does not have root privileges.'
|
||||
listener.options.log('Your node instance does not have root privileges. '
|
||||
+ 'This means that the flash XML policy file will be '
|
||||
+ 'served inline instead of on port 843. This will slow '
|
||||
+ 'down initial connections slightly.');
|
||||
+ 'down initial connections slightly. NOTE: this fails '
|
||||
+ 'with Firefox 4 betas.');
|
||||
netserver = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@ Polling.prototype.getOptions = function(){
|
||||
return {
|
||||
timeout: null, // no heartbeats
|
||||
closeTimeout: 8000,
|
||||
duration: 50000
|
||||
duration: 20000
|
||||
};
|
||||
};
|
||||
|
||||
Polling.prototype._onConnect = function(req, res){
|
||||
var self = this, body = '';
|
||||
|
||||
switch (req.method){
|
||||
case 'GET':
|
||||
Client.prototype._onConnect.apply(this, [req, res]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ "name" : "socket.io"
|
||||
, "description" : "The cross-browser WebSocket"
|
||||
, "version" : "0.6.3"
|
||||
, "version" : "0.6.8"
|
||||
, "author" : "LearnBoost"
|
||||
, "licenses" :
|
||||
[ { "type" : "MIT"
|
||||
|
||||
Reference in New Issue
Block a user