问题描述:

I been busy with openssl and C under Microsoft, currently I got the multithreaded server and clients that communicate through SSL on a TCP/IP socket. "Took me some while to read all the documents / manuals from Openssl" but hey you learn at least something.

Now I want the server to broadcast a message to all clients that are connected. I can't find any information on the internet how to accomplish this, everything for me is a bit to vague or not documented that great.

If anyone of you can provide me an Manual or anything that is related to broadcast to clients, that would be very helpful.

It doesn't have to be for microsoft, Linux / unix or anything that can pinpoint me in the right way would be awesome.

网友答案:

OpenSSL won't help you do that (ie broadcasting), either with or without TLS layer your problem is the same as broadcasting an information over mutliple TCP sockets. I don't see any other way than to send the very same information on all clients.

网友答案:

TCP have no concept of broadcasting. Whatever data you want to "broadcast" has to be manually sent to every individual TCP connection that you have established. The fact that you are using OpenSSL is irrelevant, as broadcasting has nothing to do with SSL/TLS itself. You would have to keep track of the connected clients, and then loop through them when needed sending your broadcast data to each client one at time, the same way you would send any other data, SSL/TLS or otherwise.

相关阅读:
Top