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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:28:37+00:00 2026-05-12T18:28:37+00:00

I got a c++ non-blocking server socket, with all the clients stored in a

  • 0

I got a c++ non-blocking server socket, with all the clients stored in a std::map structure.

I can call the send() method for each clientObject to send something to the connected client and that works pretty good already.

But for sending a message to all (broadcast?) i wanna know:
there is something better than do a for/loop with all the clients and call to ClientObject->send(“foo”) each iteration?

Or should i just try having a peek on multicast sockets?

Thanks in advance.
Rag.

  • 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-05-12T18:28:37+00:00Added an answer on May 12, 2026 at 6:28 pm

    Multicast is only an option if you’re communicating over a LAN. It won’t work over the Internet.

    What you may want to do here is to demultiplex the sockets using asynchronous I/O. This allows you to send data to multiple sockets at the same time, and use asynchronous event handlers to deal with each transmission.

    I would recommend looking into Boost ASIO for a portable way to do this. You can also use OS specific system calls, (such as poll/select on UNIX or epoll on Linux) to do this, but it is a lot more complicated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way I can use python's socket.accept() in a non-blocking way that
I've got a number of non-technical users that all share a set of project
I've got the following code, and need to strip all non alpha numeric characters.
Using non-blocking (20 ms cycle) TCP connection in linux, I got a problem: when
I've got a const method in my class, which cannot be changed to non-const.
I got this following method in an non Activity class, My code is below.
We've got a non-profit site that's been up for over 10 years; though it's
We have a non-profit web site that got about 5 million hits in May.
Has anybody got this to actually work? Documentation is non existent on how to
I'm involved in building a donation form for non-profits. We recently got hit by

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.