mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 07:58:13 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5b2028577 | ||
|
|
7f08d8fd59 | ||
|
|
ffb0574a76 | ||
|
|
e57e27ee43 |
@@ -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
|
||||
==================
|
||||
|
||||
|
||||
@@ -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]);
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user