This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author techtonik
Recipients techtonik
Date 2009-02-17.10:06:32
SpamBayes Score 5.3118283e-09
Marked as misclassified No
Message-id <1234865194.48.0.771054694385.issue5293@psf.upfronthosting.co.za>
In-reply-to
Content
The code below exits with timeout after about 20 secs on Windows +
Python 2.5.4

import socket
# address of server routable, but offline
server = "192.168.1.2"
s = socket.socket()
s.setblocking(1)
s.connect((server, 139))
s.close()

The output is:

Traceback (most recent call last):
  File "D:\.env\test.py", line 6, in <module>
    s.connect((server, 139))
  File "<string>", line 1, in connect
socket.error: (10060, 'Operation timed out')

If timeout is set to 1 it exits almost immediately. If timeout is large
it waits for about 20 seconds and exits.

I use socket to wait for the network service to appear. The target
machine 192.168.1.2 belongs to local network, but offline.
History
Date User Action Args
2009-02-17 10:06:34techtoniksetrecipients: + techtonik
2009-02-17 10:06:34techtoniksetmessageid: <1234865194.48.0.771054694385.issue5293@psf.upfronthosting.co.za>
2009-02-17 10:06:33techtoniklinkissue5293 messages
2009-02-17 10:06:32techtonikcreate