Skip to content

Commit

Permalink
Limit the number of connected clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Mottram committed May 27, 2021
1 parent 65b2a74 commit 661a25b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miniircd
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,8 @@ class Server:
else:
if int(time.time()) - last_connection_attempt < 3:
continue
if len(self.clients) >= self.max_clients:
continue
last_connection_attempt = int(time.time())
conn, addr = x.accept()
if self.ssl_key_file:
Expand Down

0 comments on commit 661a25b

Please sign in to comment.