Docs : missing next() function of the middleware in the documentation.#4515
Closed
jacerchetoui56 wants to merge 34 commits intomasterfrom
Closed
Docs : missing next() function of the middleware in the documentation.#4515jacerchetoui56 wants to merge 34 commits intomasterfrom
jacerchetoui56 wants to merge 34 commits intomasterfrom
Conversation
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:
- #1811
- #4163
- socketio/socket.io-redis-adapter#445
This is similar to `onAny()`, but for outgoing packets.
Syntax:
```js
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
```
This commit handles several edge cases that were silently ignored before: - receiving several CONNECT packets during a session - receiving any packet without CONNECT packet first
Production: - socket.io-parser: ~4.0.4 => ~4.2.0 Development: - superagent: ^6.1.0 => ^8.0.0 - tsd: ^0.17.0 => ^0.21.0 Related: #3709
This should fix a rare case where the Engine.IO connection was upgraded to WebSocket while the Socket.IO socket was disconnected, which would result in the following exception: > TypeError: Cannot read properties of undefined (reading 'forEach') > at subscribe (/node_modules/socket.io/dist/uws.js:87:11) > at Socket.<anonymous> (/node_modules/socket.io/dist/uws.js:28:17) > at Socket.emit (node:events:402:35) > at WebSocket.onPacket (/node_modules/engine.io/build/socket.js:214:22) > at WebSocket.emit (node:events:390:28) > at WebSocket.onPacket (/node_modules/engine.io/build/transport.js:92:14) > at WebSocket.onData (/node_modules/engine.io/build/transport.js:101:14) > at message (/node_modules/engine.io/build/userver.js:56:30) Related: #4443
Note: some disconnection reasons could be merged in the next major release, i.e. the Deno impl does not have "forced server close" and "server shutting down" Related: #4387
Typed events were not applied when calling "io.timeout(...).emit()". Related: socketio/socket.io-client#1555 (comment) Reference: https://socket.io/docs/v4/typescript/
Member
|
@jacerchetoui56 Hi! Thanks for the pull request. It seems something is not right here, could you please check? Were you looking for the https://github.com/socketio/socket.io-website repository instead? |
In order to fix CVE-2022-2421. See also: GHSA-qm95-pgcg-qqfq
In order to fix CVE-2022-41940. See also: GHSA-r7qp-cfhv-p84w
Member
|
Closed due to inactivity, please reopen if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A missing next() function in the middleware in the documentation, more specifically in the "Additional attributes" on this link