Examples are usually simplified. Scalability is a serious problem, and I suggest that it would be better to start with simpler applications; a thousand client connections may be required, but most applications will require fairly careful development. Socket programming can be difficult.
There are various types of server applications; There is no single approach that would ideally fit all tasks. There are many details to consider (is this a streaming or datagram service?) Are the connections, if any, permanent, does it include many small data transmissions, or several huge transmissions, or many huge transmissions? Et cetera, et so on). This is why you are unlikely to see any common examples in books.
If you choose a thread approach, be careful not to create too many threads; one thread per client is usually (but not always) a bad choice. In some cases, you can process everything in one thread (using async IO) without sacrificing any performance.
Having said that, I would recommend learning C ++ and raising asio (or a similar structure). He takes care of many problems related to scalability, so there is no point in reinventing the wheel.
You can study the book "Applications with the architecture of Open Source Applications" ( freely available ). There are a few examples that may come in handy.
source share