Compare commits

...

4 Commits
0.6.3 ... 0.6.4

Author SHA1 Message Date
Guillermo Rauch
f5b2028577 Release 0.6.4 2011-01-05 11:21:37 -08:00
Fabian Jakobs
7f08d8fd59 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.

According to the node documentation "destroy" is
only necessary in case of a errors.
2011-01-05 13:25:35 +01:00
Mathew Rodley
ffb0574a76 Added try/catch block around JSON.parse and return an empty object literal
if JSON parsing fails.
2010-12-30 13:18:27 +11:00
Guillermo Rauch
e57e27ee43 Added missing .connect() to example 2010-12-24 13:02:35 -08:00
4 changed files with 14 additions and 3 deletions

View File

@@ -1,4 +1,11 @@
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
==================

View File

@@ -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(){ … })

View File

@@ -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]);
@@ -127,7 +131,6 @@ Client.prototype._onClose = function(skipDisconnect){
this._open = false;
if (this.connection){
this.connection.end();
this.connection.destroy();
this.connection = null;
}
this.request = null;

View File

@@ -1,6 +1,6 @@
{ "name" : "socket.io"
, "description" : "The cross-browser WebSocket"
, "version" : "0.6.3"
, "version" : "0.6.4"
, "author" : "LearnBoost"
, "licenses" :
[ { "type" : "MIT"