Skip to content

Support callbacks when sending to a specific client (Does this count as a broadcast?) #3438

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

Closed
aarmora opened this issue May 1, 2019 · 2 comments

Comments

@aarmora
Copy link

aarmora commented May 1, 2019

You want to:

  • [] report a bug
  • [X ] request a feature

Current behaviour

When using the socket.io server and sending to a specific client with socket.to('destination').emit('event', 'message', callBackFunction); it throws this error. While maybe this error message needs to be updated (unless this is actually viewed as a broadcast), the function certainly does not currently support callbacks when sending to a specific client.

Desired behaviour

Callbacks supported when sending directly to a client.

Setup

  • OS: Windows
  • browser: Chrome 73
  • socket.io version: 2.2.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

While it seems logical to not support callbacks on .broadcasts, sending an .emit to a specific client seems like it would make sense. Is there something that I am missing that makes this a silly feature?

Anyone else that has had this issue, have they just had to manually implement their own acks?

I really appreciate all of your work on this great package!

@tingtingtinghuang
Copy link

@darrachequesne Sorry to mention you here.
Is there any other solution to solve this problem? When I send message to specific client, I can't use ack as it regarded a broadcast.

@darrachequesne
Copy link
Member

Duplicate of #1811

@darrachequesne darrachequesne marked this as a duplicate of #1811 Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants