Hi all,

Working to my HE Net Server and Client(s).

I have some questions for the sockets gurus :

Lets say that i use WSAAsyncSelect... and i expect about 1000 connections to my server (in my dreams)

So is there any problem (beside server response speed) like any limitations in sockets number per application or connections number per application?

I have read some FAQ on internet that claim i can not use more than 64 sockets on my App ... this will obviousely be no problem for the client that will use max 1-2 sockets ... but for the server can i safely use 1000+ sockets?

There is a limit to 4-5000 connections in a Win2K Workstation?

Should Win2k Server perform much better than Win2K workstation for hosting such a server?
Posted on 2003-04-30 10:25:38 by BogdanOntanu
The 64 socket limitation is probably using the FD_SET stuff (select).

I don't know if there's a max number of connected sockets (as in a nazi limit enforced - of course there's a hardware limit), but workstation/server handles backlog and other parameters differently.

Workstation has limit on the number of TransmitFile, though. And iirc there may be a limit on the amount of SMB (windows networking) clients?

You probably shouldn't use asyncselect - eventselect is better. Refer to www.madwizard.org .
Posted on 2003-04-30 10:30:40 by f0dder
Thnaks for the good news about no limits.

I will also investigate eventselect ...
Posted on 2003-04-30 11:25:46 by BogdanOntanu
Well, I'm not 100% sure about the "no limits" - I don't think there's a silly low limit on sockets though. If you need huge amounts of clients, I guess server versions might do better.

Note that, because of the MAXIMUM_WAIT_OBJECTS limit of WaitForMultipleObjects, you'd still need more than one thread to handle > 64 clients (well... depend on MAXIMUM_WAIT_OBJECTS instead of 64, who knows if microsoft bumps it for a future windows version :-)).

Do you plan on supporting >64 players per game session? If not, and you just want the server to handle multiple game sessions at once, then the limit shouldn't be any problem at all.
Posted on 2003-04-30 11:40:40 by f0dder
Well i want the server just for chat/channels , clients login/logout, and statistics on game

When a game is created the IP of the creator has to be known to other clients for them to be able to join DirectPlay session

Curently for TCP/IP internet play this game greator IP has to be entered manually into a he_servers.txt file -- but this has to change

I might remove DirectPlay in a later version of HE (as i become more used with sockets) but curently i use it

So the server just informs the clients about created games and the IP of the creator... once the clients join they are out of server bounds, game works peer-to-peer between all clients inside a DirectPlay session.

Max players inside a game is expected to be 8-16 with a mean value of 6 (3v3)

But max players in server and/or channel is undefined... i guess i will have to limit the max player in a channel to 64? or less just to keep chat messages send to a limited ammount of clients

I think at least the game creator/dynamic host must keep a kind of connection to the server while game is going on... actually i guess all players will keep conections in order to recive messages from chat and/ or inform server of game endings (win/looss etc)

But there will be very limited and ocasional communication with the server during game play... however the connection will still be there for info purpose...
Posted on 2003-04-30 12:06:01 by BogdanOntanu
Ok, sounds to me like possibly a lot of clients, but without very high bandwith or latency requirements.

It should be possible to get something going with eventselect that works pretty well. Takes a little coding because of the MAXIMUM_WAIT_OBJECTS=64 limit - "some sort of worker thread pool or something". Asyncselect is simpler, and while I don't really like it, it might be able to handle your situation since it sounds like "Low requirements". If your target is NT, you might want to look into IO completion ports - perhaps a bit overkill, but they sound like a pretty nifty thing.
Posted on 2003-04-30 12:17:32 by f0dder
Here is the website where you can find a lot of useful info about winsock programming: http://tangentsoft.net/wskfaq/
And here is the answer to your question: http://tangentsoft.net/wskfaq/advanced.html#maxsockets
Posted on 2003-04-30 16:15:37 by masnick[CCCP]
masnick, thanks for the URL, I had lost it a while ago and totally forgot about it :) :stupid:

Sounds like there aren't any "you need to buy the server product" type of limitation on amount of sockets. Nice.

Posted on 2003-04-30 16:21:56 by f0dder
No Problem.:cool:
Posted on 2003-04-30 17:12:47 by masnick[CCCP]