Syntax:
```js
io.timeout(1000).emit("some-event", (err, responses) => {
// ...
});
```
The adapter exposes two additional methods:
- `broadcastWithAck(packets, opts, clientCountCallback, ack)`
Similar to `broadcast(packets, opts)`, but:
* `clientCountCallback()` is called with the number of clients that
received the packet (can be called several times in a cluster)
* `ack()` is called for each client response
- `serverCount()`
It returns the number of Socket.IO servers in the cluster (1 for the
in-memory adapter).
Those two methods will be implemented in the other adapters (Redis,
Postgres, MongoDB, ...).
Related:
- https://github.com/socketio/socket.io/issues/1811
- https://github.com/socketio/socket.io/issues/4163
- https://github.com/socketio/socket.io-redis-adapter/issues/445
This is a squash of about 25 commits, and here is a summary:
adamreis added initial binary test with the doge image.
kevin-roark updated binary tests and wrote some binary encoding protocol.
kevin-roark replaced the custom binary encoding with msgpack because we
have to handle arbitrary json that contains binary.
adamreis added some 'crazy' tests for emmiting and receiving events with
several types of data.
kevin-roark updated client.js to use socket.io-protocol's async encoding
Did a bunch of upstream merging.