The first time I write sockets in a normal language and these are the questions I have. Previously, I created a server and for each client I created a copy of server logic, which allowed me to communicate directly with each client separately. But it was not code, but graphics, i.e. I made the necessary functionality from cubes, and the code itself remained hidden for me. The process of creating a copy of server logic for me was not fully disclosed.
It is possible to explain in detail with ordinary words what follows what. For example, I created a socket on the n port, the first client connected, how to "move" it to its copy of the logic? How to communicate with each client in a separate thread?