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 8229623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:51:30+00:00 2026-06-07T16:51:30+00:00

I can happily send messages to the clients from the server and also to

  • 0

I can happily send messages to the clients from the server and also to the server from the clients. I, however, seem to need to send (broadcast) messages to the (server) sockets from the server itself — and I don’t know how to go about it.

The case is that the server learns (via a Redis subscription) that a subset of the possibly very numerous clients need to be sent a message. Each server side socket can determine on its own if it needs to fire or not. I just don’t know how to let them know they have to do the check (possibly in much the same way as ‘normally’ by a message from the client (?)).

FWIW the check can be made by using the handshakeData only (and other non-socket-instance-specific server side structures). If there’s a way to get to the handshakeData ‘from the outside’, it’s also a possibility; but by no means really pretty.

Any thoughts/pointers anyone?

  • 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-07T16:51:32+00:00Added an answer on June 7, 2026 at 4:51 pm

    I seem to have got it finally (by debugging the socket.io code).

    Within a message handler fetch the socket in question and have a ‘params’ array set with the event and other attributes (usually a ‘data’ object with additional info). With these two call socket.$emit.apply(socket, params).

    In actual code:

    for (var socketId in io.namespaces['/mynamespace'].sockets) {
        var socket = io.namespaces['/mynamespace'].sockets[socketId];
        var params = ['test event', {'foo': 'bar'}];
        socket.$emit.apply(socket, params);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Ubuntu I compiled sbcl 1.0.35 with threading. I can happily use sbcl from
I have: public static int[] ArrayWorkings() I can call it happily with MyClass.ArrayWorkings() from
Can I order my users in the database, so I don't have to say
I have a CSV file and using fgetcsv I can happily generate each line
In C (or a language based on C), one can happily use this statement:
I am using two large libraries (GUI & network) and I can happily do
I have a very simple table and I can happily query it using LINQ
Using the force layout in d3, I can happily add nodes as, say, an
I have a system where users can complete two types of tests. I need
Can anyone let me know how can we change the value of kendo combobox

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.