Hi. At the moment the server for my MMORPG accepts connections with a TIdTcpServer component and then holds a thread for each connected player. I've done a little more reading around the subject and have found that:

A) I shouldnt use a thread per player, with many players in the same area affecting the same area, extra threads would cause blocking on locks. The solution to this according to GameDev is to:

using select() and reading out what's there, then processing it, is recommended.
But the problem I have with this is that when I dont keep a record of the active clients in threads, I wouldnt be able to send new data back to a different client when new information comes in..

B) The second problem is that I should assign a different port number for each connection. I dont know if the TIdTCPServer does this automatically or not but I assume it doesnt and I couldnt find away to do this. If it does do this automatically, is there a way to generate all necessary sockets at the start of the program as I've heard generating sockets on the fly is quite time consuming...

Can anyone think of any possible solutions to either of these to issues?