Tal Beja
955e5e0d91
[feature] Add a local flag ( #2628 )
...
That new flag will prevent the adapter (redis) from publishing the emit to the pub/sub server.
When several instances of a server receive the same event from a third party (not from a client), each server instance broadcasts the event to all his clients. With the local flag, and the change in the redis adapter, each server instance send the event only to his client, so each client receive only one unique event.
2016-11-24 23:44:52 +01:00
Luca Tabone
ff2c15de68
[perf] Minor code optimizations ( #2219 )
2016-11-18 02:03:06 +01:00
Zheng Weihan
1d84c55743
fix to issue #331 on socket.o-client.
...
Parses CONNECT packet for query string and replaces query in socket.handshake.
2016-01-28 14:40:05 +08:00
Hongcai Deng
7012ba6c64
fix wrong jsdoc
2015-12-14 15:31:42 +08:00
Guillermo Rauch
3b00312fa7
namespace: clear rooms flag after a clients call ( fixes #1978 )
2015-11-23 09:40:57 -08:00
Damien Arrachequesne
09f446eca0
Add hasOwnProperty checks
2015-11-23 15:12:21 +01:00
Damien Arrachequesne
b73d9bea4e
converted arrays to objects
2015-11-22 11:12:40 +01:00
Damien Arrachequesne
a1a1c6657a
Removed unused variable
2015-11-20 22:00:42 +01:00
Naoyuki Kanezawa
53cdd8f1fc
support flags on namespace
2015-02-20 03:34:09 +09:00
Ruben Rodriguez II
8814825a35
Suggestion for implementation of clients API
2015-01-31 02:17:49 -06:00
Guillermo Rauch
1b01e16a6c
fix broken previous commit
2015-01-24 08:02:05 -08:00
Guillermo Rauch
44a79f9cee
server: make Server#adapter work after construction
2014-03-07 18:33:36 -03:00
Kevin Roark
c2bf0ea700
Added binary support to broadcasting of events
...
lib/namespace.js previously was not considering whether an event had
binary data and was giving all events parser.EVENT type -- now it uses
the has-binary-data module to set the event type appropriately.
Then, after this fix there was a problem with lib/adapter.js -- because
socket.io-parser modifies the packet object in its encoding, the sockets
after the 1st in a broadcast were not getting the correct data. To fix
this, the data is encoded once in adapter, and then the encoded data
is passed to each of the sockets.
lib/socket.js and lib/client.js were updated to allow for the above. The
.packet method of each now takes an optional second "preEncoded" parameter
-- if this is true, then client skips the encoding and just writes the
packet argument directly to engine.
test/socket.io.js was updated to add two new tests that test
multi-messaging of events with binary data.
2014-03-02 22:15:16 -05:00
Guillermo Rauch
da844159d9
namespace: jshint friendly usage of reserved keyword for backwards-compatibility
2013-12-24 20:10:16 -03:00
Guillermo Rauch
c545e3b963
lib: fix style
2013-12-24 19:56:01 -03:00
Guillermo Rauch
5f843feb90
namespace: make sure not to fire connection if underlying client closed after next is called from a middleware
2012-12-24 19:50:25 -03:00
Guillermo Rauch
dd0fd539e6
namespace: fix emit
2012-12-23 23:19:05 -03:00
Guillermo Rauch
5d4f90de47
namespace: make in able to track multiple rooms
2012-12-23 23:18:48 -03:00
Guillermo Rauch
59c8c34ceb
namespace: fix flags
2012-12-23 23:18:38 -03:00
Guillermo Rauch
bcfec6df76
namespace: added connected hash
2012-12-23 23:18:26 -03:00
Guillermo Rauch
dbba592dfa
namespace: implement own flags
2012-12-23 23:18:14 -03:00
Guillermo Rauch
97b63b0860
namespace: blacklist newListener event
2012-12-18 14:56:44 -03:00
Guillermo Rauch
3a259d420c
namespace: improve middleware logic
2012-12-18 14:55:58 -03:00
Guillermo Rauch
c67d2d5494
namespace: instrument add
2012-12-17 08:29:43 -03:00
Guillermo Rauch
70ce641d85
namespace: fix run call
2012-12-16 23:50:46 -03:00
Guillermo Rauch
b6a4899689
initial 1.0 commit
2012-12-13 12:14:54 -03:00
einaros
63043b3d5d
fixes leak #608
2011-10-31 22:47:25 +01:00
Guillermo Rauch
0224e4ac5f
Merge pull request #569 from 3rd-Eden/blacklist
...
Blacklist events
2011-10-11 08:13:55 -07:00
Arnout Kazemier
ecd20b0e1f
Added support for blacklisting events that are emitted from the client side.
...
Currently it's possible for a client do .emit('disconnect') and this will trigger
the disconnect event on the server.. Which can lead to major issues.
We should black list that by default. You can override or add more events by adding
them to the `blacklist` setting
2011-10-11 10:40:22 +02:00
Arnout Kazemier
b8f6dc7810
Inital stab at blacklisting client side events
2011-10-11 09:53:26 +02:00
Arnout Kazemier
b3740e9ab6
fixes #538
2011-10-10 21:52:16 +02:00
Guillermo Rauch
7ac9c2e888
Fixed style
2011-09-03 10:48:23 -07:00
Guillermo Rauch
984639ba67
Merge pull request #381 from 3rd-Eden/alias
...
Added alias for to to in and in to to
2011-07-30 20:27:30 -07:00
Arnout Kazemier
a821cce390
Fix for #407
2011-07-22 22:52:20 +02:00
Arnout Kazemier
53f0f4d66d
Added alias for to to in and in to to
2011-07-14 21:31:55 +02:00
Guillermo Rauch
8798cfbced
Merge pull request #340 from 3rd-Eden/291
...
It was emitting uknown room, so the messages where never send
2011-07-12 00:55:49 -07:00
Guillermo Rauch
d3eac92eaa
Leveraged $emit instead of emit internally.
2011-07-12 04:28:55 -03:00
Arnout Kazemier
d39d1401c4
Fixed broken test suite
2011-07-05 00:59:31 +02:00
Arnout Kazemier
a70347b15f
Fixed #285
2011-07-05 00:37:19 +02:00
Arnout Kazemier
1a2c8aa31f
It was emitting uknown room, so the messages where never send fixes #291
2011-07-05 00:17:02 +02:00
Vladimir Dronnikov
44919189ec
normalize SocketNamespace local eventing
2011-06-30 03:12:55 -07:00
Arnout Kazemier
06e29fef67
Use packet.reason or default to 'packet'
2011-06-29 21:58:13 +02:00
Arnout Kazemier
16518c0715
Added a small indicator + test suite so you can see how a user is disconnected
2011-06-29 21:45:14 +02:00
Arnout Kazemier
299e097fa7
Added storage for socket.handshake & updated test suite to check for it
2011-06-28 23:50:33 +02:00
Arnout Kazemier
8abe712294
Passes test suite
2011-06-28 21:41:46 +02:00
Guillermo Rauch
fb79657476
Added SocketNamespace#clients
2011-06-28 13:33:01 -03:00
Guillermo Rauch
cbc12ecdcf
Make sure to leave rooms upon disconnection of a namespace (fixes some bug).
2011-06-27 15:31:44 -03:00
Guillermo Rauch
9aa650e430
Removed the join callback, since it's not necessary (TCP based pub/sub guarantees
...
proper total ordering).
2011-06-27 15:30:47 -03:00
Guillermo Rauch
f06fefab14
Added handleDisconnect method to emit the disconnect event when the socket is
...
disconnected due to network reasons, making sure we don't emit it on non-connected
namespaces.
2011-06-27 15:30:02 -03:00
Guillermo Rauch
5b6efb784f
Simplified global message dispatching by leveraging subscriptions.
2011-06-27 15:28:24 -03:00