Jump to content

Yo :D

Aaight, so I'm a noob to c++. Like really, but I'm somewhat experienced in other languages, but that's not the point.

I've got sockets working, I've done the client side fully, but the server is in the smallest of scales: 1. Now I'm gonna keep walking towards my objective. But it's sort of insane so buckle up for some potential cringe.

The final goal is to have a fully functional server that can receive requests from multiple devices, each of those requests "ID"ed and kept open for as long as the connection lasts, so the server can communicate to the client in real time. Problem is: I have no idea how to do it. I've read a bit about this, threading, thread pools, asynchronous stuff, but what I'm having a hard time on is knowing where to begin coding wise.

I want to make everything as optimized as possible. I don't want useless threads lying around, or more than needed. But I really don't get how I should coordinate that. Or even do it actually.

So I need your help to understand the concepts of multi-threading in this situation and what would be the most optimal choice given the final goal.

 

I know this is really ambiguous and dumb but I just need a head start and something to grab on to so I can start working.

Thank you for your time : P 

Have a nice day :D

Link to comment
https://linustechtips.com/topic/604120-scaling-socket-communication-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×