-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: when we use cluster adapter on linux (client A send message to Client B with callback ) #4163
Labels
enhancement
New feature or request
Milestone
Comments
introspection3
changed the title
bug: when we use cluster adapter on linux (client A send Client B with callback )
bug: when we use cluster adapter on linux (client A send message to Client B with callback )
Nov 11, 2021
Yes, this is expected. Related: #1811 |
darrachequesne
added a commit
to socketio/socket.io-adapter
that referenced
this issue
Mar 29, 2022
Tests will be added in the parent repository. Related: - socketio/socket.io#1811 - socketio/socket.io#4163
darrachequesne
added a commit
that referenced
this issue
Mar 31, 2022
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
darrachequesne
added a commit
to socketio/socket.io-cluster-adapter
that referenced
this issue
Apr 28, 2022
This feature was added in `socket.io@4.5.0`: ```js io.timeout(1000).emit("some-event", (err, responses) => { // ... }); ``` Thanks to this change, it will now work with multiple Socket.IO servers. Related: socketio/socket.io#4163
This use case is now supported by |
darrachequesne
added
enhancement
New feature or request
and removed
bug
Something isn't working
labels
Apr 28, 2022
dzad
pushed a commit
to dzad/socket.io
that referenced
this issue
May 29, 2023
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: - socketio#1811 - socketio#4163 - socketio/socket.io-redis-adapter#445
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
bug: when we use cluster adapter on linux (windows ok) (client A send Client B with callback ),will go wrong
at BroadcastOperator.emit (/opt/fastnat/index.js:162511:19)
at RemoteSocket.emit (/opt/fastnat/index.js:162604:30)
at /opt/fastnat/index.js:729:30
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2021-11-09T21:36:53.490 ERROR default 3944986 :==> Error: Callbacks are not supported when broadcasting
at BroadcastOperator.emit (/opt/fastnat/index.js:162511:19)
at RemoteSocket.emit (/opt/fastnat/index.js:162604:30)
at /opt/fastnat/index.js:729:30
at processTicksAndRejections (node:in
To Reproduce
Please fill the following code example:
Socket.IO server version:
x.y.z
"socket.io": "^4.1.3",
"socket.io-client": "^4.1.3",
The text was updated successfully, but these errors were encountered: