Question on Socket Timeouts

Abhijeet Mahagaonkar abhi.forall at gmail.com
Sun Nov 18 03:27:22 EST 2012


Hi all,

I'm new to network programming.
I have a question.

Can we set a timeout to limit how long a particular socket can read or
write?

I have used a settimeout() function.
The settimeout() works fine as long as the client doesnt send any data for
x seconds.
The data that I receive in the server after accept()ing a connect() from a
client I check if the client is sending any invalid data.

I'm trying to ensure that a client sending invalid data constantly cannot
hold the server. So is there a way of saying I want the client to use this
socket for x seconds before I close it, no matter what data I receive?

Thanks in advance,

-Abhijeet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121118/bf516e37/attachment.html>


More information about the Python-list mailing list