I want to restrict every user (read: IP address) that connects to my webserver to a fixed maximum number of connections. Right now, everyone can set up unlimited connections to my server and eat up the maximum connections of the server. Any ideas on how to do this with winsock?
I've seen websites that wouldn't let me download more than 2 files simultaniously, so it should be possible..

Posted on 2001-12-02 12:46:45 by Thomas
Hm, perhaps in accept? You can get the IP number of the incoming
connection, and if there are already too many connections, close the
socket immediately?
Posted on 2001-12-02 12:55:46 by f0dder
I think that is the best option.. When I download more than two files from the same website, the third connection is not shut down, but just waiting for one of the others to complete. This was what I was looking for
However I just realized that the restriction on downloading multiple files is not done by the server, but by the browser. The HTTP standard also suggests using 2 connections simultatiously at most. So I think I can safely close further connections.


Posted on 2001-12-02 13:12:31 by Thomas
There's some registry entry you can tweak to get more than two
connections. Also, servers *can* (and do ;)) limit per IP.
Posted on 2001-12-02 13:19:44 by f0dder
visit www.regedit.com
there you find alot usefull win registry tweaks ,like how to set maxconnectionsperserver....
Posted on 2001-12-14 14:03:51 by Max