After some time struggling with the server I finally managed to produce a working version of the idea of bringing all sockets from server to winsock and then closing all of them. Tested with 1026 sockets and seems to work as expected by bringing 128 sockets per request from the server.
This is certainly too much for code freeze but I plan to send after it, feedback is very much welcome since mistakes are always possible when working after midnight.
Best wishes, Bruno