By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

sleep in asyncore

P: n/a
Hi all.
I'm writing an authentication server by using asyncore / asynchat
modules.
I'd like to implement a basic brute-force protection by "freezing /
sleeping" the current client session for a period of time (e.g. 2
seconds) when the user sends a wrong password.
Does someone knows a "trick" to do that with asyncore?
Thanks in advance for your helping.

Jan 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"billie" <gn****@gmail.comwrote:
I'm writing an authentication server by using asyncore / asynchat
modules.
I'd like to implement a basic brute-force protection by "freezing /
sleeping" the current client session for a period of time (e.g. 2
seconds) when the user sends a wrong password.
Does someone knows a "trick" to do that with asyncore?
this could work:

add a timeout variable to your dispatcher instance, and have your "readable"
method returns False if timeout is set and the current time is before the given
value. then set the timeout value to time.time() + 2 when you see a bad pass-
word.

</F>

Jan 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.