Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7768641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:57:55+00:00 2026-06-01T15:57:55+00:00

To send something to all clients, you use: io.sockets.emit(‘response’, data); To receive from clients,

  • 0

To send something to all clients, you use:

io.sockets.emit('response', data);

To receive from clients, you use:

socket.on('cursor', function(data) {
  ...
});

How can I combine the two so that when recieving a message on the server from a client, I send that message to all users except the one sending the message?

socket.on('cursor', function(data) {
  io.sockets.emit('response', data);
});

Do I have to hack it around by sending the client-id with the message and then checking on the client-side or is there an easier way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:57:56+00:00Added an answer on June 1, 2026 at 3:57 pm

    Here is my list (updated for 1.0):

    // sending to sender-client only
    socket.emit('message', "this is a test");
    
    // sending to all clients, include sender
    io.emit('message', "this is a test");
    
    // sending to all clients except sender
    socket.broadcast.emit('message', "this is a test");
    
    // sending to all clients in 'game' room(channel) except sender
    socket.broadcast.to('game').emit('message', 'nice game');
    
    // sending to all clients in 'game' room(channel), include sender
    io.in('game').emit('message', 'cool game');
    
    // sending to sender client, only if they are in 'game' room(channel)
    socket.to('game').emit('message', 'enjoy the game');
    
    // sending to all clients in namespace 'myNamespace', include sender
    io.of('myNamespace').emit('message', 'gg');
    
    // sending to individual socketid
    socket.broadcast.to(socketid).emit('message', 'for your eyes only');
    
    // list socketid
    for (var socketid in io.sockets.sockets) {}
     OR
    Object.keys(io.sockets.sockets).forEach((socketid) => {});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I send text to my DLL and receive it as char* , something
I'm trying to send data from client-side to server-side (asp.net c#), if you really
I apologise if this is a bit dim but I want to send something
As most production environments we have setup something to send us a notification if
In mootools I would do something like $('form_id').send({success:function(res){....}}); What is the parallel syntax in
Can i send the request to load certain div with a url only something
Something weird's happening with my Rails app. When I try to send an update
I was wondering something. How does this email look when it will be send
I have something like: <h:commandButton> <h:ajax event=click listener=#{controller.onLog} onchange=onLogProcess /> .... </h:commandButton> I send
Is there any way I can send an email, like any frameworks or something.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.