Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > timeoutsocket - not blocking on connect?

Reply
Thread Tools

timeoutsocket - not blocking on connect?

 
 
Raja
Guest
Posts: n/a
 
      02-13-2004
Hello
Im trying to catch timeouts from a socket and my code looks like
try:
timeoutsocket.setDefaultSocketTimeout(10)
s = timeoutsocket.timeoutsocket(timeoutsocket.AF_INET,
timeoutsocket.SOCK_STREAM)
print s.get_timeout()
s.connect(("localhost", 80))
except timeoutsocket.Timeout:
print 'Timeout'

I do give a SIGSTOP on my webserver so that all the requests hang and
i have created a timeout situation.(When i connect to
http://localhost, it hangs).

I looked at timeoutsocket.py and it looks like the connect() does call
socket.connect and then does a select.select using the sock. In my
case, it does have the write file descriptors not blocking and so it
does return back. Shouldnt it just return a timeout for the above
case? The documentation on timeoutsocket.py mentions that if the
timeout needs to be captured on connect(), u shud use the
setdefaultsockettimeout.


Im a newbieee so go easy on me. Please let me know if you need any
more info.

TIA
Raj
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
timeoutsocket.py mirror? skilpat@gmail.com Python 4 07-13-2005 11:02 PM
stealth-blocking, isp blocking website Dhruv Computer Security 9 01-25-2005 05:37 PM
Blocking and non blocking assignment in VHDL Hendra Gunawan VHDL 1 04-08-2004 06:03 AM
timeoutsocket.py Gilles Lenfant Python 8 11-04-2003 06:33 PM
xmlrpclib/timeoutsocket not happy together in 2.3 Larry Python 0 09-16-2003 07:30 PM



Advertisments