Experienced Elementalist
- Joined
- Aug 23, 2012
- Messages
- 217
- Reaction score
- 263
I do not know much about available C/C++ APIs (on Java I use Netty), but you want to use something called asynchronous (or non-blocking) I/O. Generally speaking, with non-blocking I/O, you will get notified about incoming packets on all connections sequentially. That is, you only have one thread which handles all player messages in a single loop, often referred to as game-loop. You then use your #cores threads for other parallel computation, e.g. monster AI.
I've made command line client that connects with my emulator (some call it clientless?).
You can stress/load test this emulator now, looks like it handles 90 clients very well.
It makes random movement and auto accepts party.
Repository:
You must be registered to see links