Skip to content
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

Suggestion: Make it possible to access sockets in different nodes without BroadCastOperator #548

Open
knixer opened this issue Sep 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@knixer
Copy link

knixer commented Sep 4, 2024

Make it possible to access a socket in a different node without broadcasting. I cant use ack:s when emitting from a socket that I got from

const sockets  = io.of(namespace).fetchSockets()
const socket = sockets.find(socket => socket.id === recipientSocketId) 
socket.emit("path", data,  (ack) => {data})

or
io.of(namespace).to(recipientSocketId).emit("path", data, (ack) => {data})

The error message I get is "Callbacks are not supported when broadcasting at BroadcastOperator.emit"

@darrachequesne
Copy link
Member

Hi!

Which version of socket.io are you using? Callbacks when broadcasting are supported since version 4.5.0: https://socket.io/docs/v4/changelog/4.5.0#broadcast-and-expect-multiple-acknowledgements

The redis adapter does too: https://socket.io/docs/v4/redis-adapter/#supported-features

@darrachequesne darrachequesne added the question Further information is requested label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants