Compare commits

...

22 Commits
1.0.3 ... 1.0.6

Author SHA1 Message Date
Guillermo Rauch
d99e30fca7 Release 1.0.6 2014-06-19 14:57:50 -07:00
Guillermo Rauch
561dd6fd79 package: bump engine.io for utf8 fix (fixes #1622) 2014-06-19 14:51:37 -07:00
Guillermo Rauch
e9e2a91cea package: bump socket.io-client 2014-06-19 08:05:38 -07:00
Guillermo Rauch
8a3a111a7f Merge pull request #1635 from rase-/add/test
Test for duplicate events on manual reconnect
2014-06-18 15:54:23 -07:00
Tony Kovanen
bd87e4dc35 Bump socket.io-client to latest commit so that duplicate events test passes 2014-06-19 01:52:34 +03:00
Tony Kovanen
71c253e992 Added test for duplicate events after manual reconnects 2014-06-19 01:49:00 +03:00
Guillermo Rauch
a5cf4f57a0 Release 1.0.5 2014-06-17 18:14:44 -07:00
Guillermo Rauch
a079cbc7f9 client: fixes #1632 2014-06-17 18:07:30 -07:00
Guillermo Rauch
14a9fdb64f package: bump engine.io 2014-06-16 08:36:01 -07:00
Guillermo Rauch
6159df3937 fixed client 2014-06-13 13:04:50 -07:00
Guillermo Rauch
6f7bab5dfd Merge pull request #1578 from kevin-roark/add/emit-buffer-test
added the client emit-buffer test
2014-06-13 10:10:40 -07:00
Guillermo Rauch
7d2b44e176 index: fix typo [thanks @yanatan16] 2014-06-11 10:42:48 -07:00
Tony Kovanen
0b5fdf995a Merge pull request #1603 from nkzawa/patch-2
Add removeListener to blacklisted events
2014-06-08 14:40:25 +03:00
Naoyuki Kanezawa
a66bea5b33 add removeListener to blacklisted events 2014-06-08 20:34:50 +09:00
Guillermo Rauch
a1a88aaaaf Merge pull request #1600 from poldridge/master
Update index.js
2014-06-06 22:36:19 -07:00
poldridge
3f817c3a18 Update index.js
Added missing hasOwnProperty check. socket.io breaks without it when Object.prototype has been extended.
2014-06-06 22:08:58 -07:00
Guillermo Rauch
99bbd74d14 Merge pull request #1582 from kevin-roark/add/clearer-example-instructions
Add/clearer example instructions
2014-06-02 20:44:34 -07:00
Kevin Roark
398511ddee Merge branch 'upstream' into add/clearer-example-instructions 2014-06-02 20:28:42 -07:00
Kevin Roark
fdf7937815 clearer instructions to install chat example 2014-06-02 20:28:19 -07:00
Guillermo Rauch
475909e642 Release 1.0.4 2014-06-02 20:08:33 -07:00
Guillermo Rauch
95acec8b94 package: bump socket.io-client 2014-06-02 20:07:07 -07:00
Kevin Roark
5812ddf2b0 added the client emit-buffer test 2014-06-01 23:20:42 -07:00
7 changed files with 73 additions and 6 deletions

View File

@@ -1,4 +1,23 @@
1.0.6 / 2014-06-19
==================
* package: bump `socket.io-client`
1.0.5 / 2014-06-16
==================
* package: bump `engine.io` to fix jsonp `\n` bug and CORS warnings
* index: fix typo [yanatan16]
* add `removeListener` to blacklisted events
* examples: clearer instructions to install chat example
* index: fix namespace `connectBuffer` issue
1.0.4 / 2014-06-02
==================
* package: bump socket.io-client
1.0.3 / 2014-05-31
==================

View File

@@ -6,6 +6,9 @@ A simple chat demo for socket.io
## How to use
```
$ cd socket.io
$ npm install
$ cd examples/chat
$ npm install
$ node .
```

View File

@@ -68,7 +68,7 @@ Client.prototype.connect = function(name){
self.sockets.push(socket);
self.nsps[nsp.name] = socket;
if ('/' == nsp.name) {
if ('/' == nsp.name && self.connectBuffer) {
self.connectBuffer.forEach(self.connect, self);
delete self.connectBuffer;
}

View File

@@ -159,7 +159,9 @@ Server.prototype.adapter = function(v){
if (!arguments.length) return this._adapter;
this._adapter = v;
for (var i in this.nsps) {
this.nsps[i].initAdapter();
if (this.nsps.hasOwnProperty(i)) {
this.nsps[i].initAdapter();
}
}
return this;
};

View File

@@ -25,7 +25,8 @@ exports.events = [
'error',
'connect',
'disconnect',
'newListener'
'newListener',
'removeListener'
];
/**

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io",
"version": "1.0.3",
"version": "1.0.6",
"description": "node.js realtime framework server",
"keywords": [
"realtime",
@@ -19,9 +19,9 @@
"test": "make test"
},
"dependencies": {
"engine.io": "1.2.2",
"engine.io": "1.3.1",
"socket.io-parser": "2.2.0",
"socket.io-client": "1.0.3",
"socket.io-client": "1.0.6",
"socket.io-adapter": "0.2.0",
"has-binary-data": "0.1.1",
"debug": "0.7.4"

View File

@@ -426,6 +426,24 @@ describe('socket.io', function(){
});
describe('socket', function(){
it('should not fire events more than once after manually reconnecting', function(done) {
var srv = http();
var sio = io(srv);
srv.listen(function(){
var clientSocket = client(srv, { reconnection: false });
clientSocket.on('connect', function init() {
clientSocket.removeListener('connect', init);
clientSocket.io.engine.close();
clientSocket.connect();
clientSocket.on('connect', function() {
done();
});
});
});
});
it('should receive events', function(done){
var srv = http();
var sio = io(srv);
@@ -619,6 +637,30 @@ describe('socket.io', function(){
});
});
it('should receive all events emitted from namespaced client immediately and in order', function(done) {
var srv = http();
var sio = io(srv);
var total = 0;
srv.listen(function(){
sio.of('/chat', function(s){
s.on('hi', function(letter){
total++;
if (total == 2 && letter == 'b') {
done();
} else if (total == 1 && letter != 'a') {
throw new Error('events out of order');
}
});
});
var chat = client(srv, '/chat');
chat.emit('hi', 'a');
setTimeout(function() {
chat.emit('hi', 'b');
}, 50);
});
});
it('should emit events with callbacks', function(done){
var srv = http();
var sio = io(srv);