http://img600.imageshack.us/img600/3567/graphicrepresentation.png
Am I reasoning right way? If so, could anyone please show me, like in scheme above, how would I/O Completion Ports work? Before I'll start to learn about making high-performance servers like ones for MMORPGs, I want to know for sure how does it all work.
With IOCP all your send and recv calls are handled by a pool of threads (a small pool is usually fine) so draw one box with send/recv in it, have 3 red dots above it and 10,000 blue ones below it.
With IOCP you issue a series of overlapped requests. Once these requests complete they are placed in a queue (the IOCP) and the threads servicing that queue can remove them and deal with them. So if you have 10,000 connections all with a single read pending on them then as data arrives from each client you'd get read completions going into the IOCP. Your threads will be woken up and will deal with the completions, they'll likely issue more overlapped reads and probably also issue overlapped writes. Most of the time you don't care when overlapped writes complete (except when you do care ;) ) and so the completion handling simply consists of releasing the per operation data (i.e. the data you just sent to the client) and decrementing the usage count on the connection...
The articles linked to from my free IOCP server framework page explain this a little more.