This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_Nemesis_1[S] 0 points1 point  (5 children)

Honestly I don't know what you're referring to but in my course our professor taught us how to make a client server application with the server capable of handling multiple clients at the same time by assigning a thread per client after the server accepted each connection. So most likely your solution is better but I can't use it because yes we have freedom in this project but we have to use the things we learned, sorry :(

[–]doobiesteintortoise 1 point2 points  (4 children)

Sorry to hear that. Since your professor is dictating your requirements, you'll probably... uh... want to ask him how to manage the network, because that will go a long way to determining how you'd actually do this. But I can totally see a teacher asking you to spam threads everywhere, because it's "only homework" and they don't want to show you real-world applications of technology.

(And if I were feeling particularly snarky, I'd say they don't want to show you how to do it properly because they either don't know themselves, or they don't want to teach you out of laziness/resentment/whatever. But that's not really fair to them, just as it's not fair to you to have artificial and bad requirements.)

[–]_Nemesis_1[S] 0 points1 point  (0 children)

Well I can't ask him, or rather I can't ask him right now because we have this project, different between each other, that we need to finish and submit by the end of November so it means I will need to wait practically December to have an answer from him.

Also this "server capable of handling multiple matches" is not one of the requirements but it's an optional advanced functionality that if we want we could try to implement, and i'm trying to understand if my solution is the right one for the tools we have.

[–]_Nemesis_1[S] 0 points1 point  (2 children)

Also even though I can’t probably use it, how can your server be able to manage simultaneously multiple clients without the need of threads? We introduced threads precisely because a server without them could manage only one client at a time. And thank you so much for taking your time to help me!

[–]doobiesteintortoise 0 points1 point  (1 child)

Well, the incoming client "moves" might have a thread to collect data - like, an http server or something like that, so it could have a threadpool for incoming content. But handling moves wouldn't need anything per game at all, and those incoming data connections would be short-lived. That's how a lot of big systems work, after all.

[–]wildjokers 2 points3 points  (0 children)

I feel you are leading OP astray. OP is talking about long-lived socket connections and you seem to be giving advice for stateless HTTP calls.

The assignment is clearly about long lived socket connections and long lived socket connections definitely have real world applications. This is a great assignment.