mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 16:08:24 -05:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d99e30fca7 | ||
|
|
561dd6fd79 | ||
|
|
e9e2a91cea | ||
|
|
8a3a111a7f | ||
|
|
bd87e4dc35 | ||
|
|
71c253e992 | ||
|
|
a5cf4f57a0 | ||
|
|
a079cbc7f9 | ||
|
|
14a9fdb64f | ||
|
|
6159df3937 | ||
|
|
6f7bab5dfd | ||
|
|
7d2b44e176 | ||
|
|
0b5fdf995a | ||
|
|
a66bea5b33 | ||
|
|
a1a88aaaaf | ||
|
|
3f817c3a18 | ||
|
|
99bbd74d14 | ||
|
|
398511ddee | ||
|
|
fdf7937815 | ||
|
|
475909e642 | ||
|
|
95acec8b94 | ||
|
|
5812ddf2b0 |
19
History.md
19
History.md
@@ -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
|
||||
==================
|
||||
|
||||
|
||||
@@ -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 .
|
||||
```
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,8 @@ exports.events = [
|
||||
'error',
|
||||
'connect',
|
||||
'disconnect',
|
||||
'newListener'
|
||||
'newListener',
|
||||
'removeListener'
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user