Message82311
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. |
|
Date |
User |
Action |
Args |
2009-02-17 10:06:34 | techtonik | set | recipients:
+ techtonik |
2009-02-17 10:06:34 | techtonik | set | messageid: <1234865194.48.0.771054694385.issue5293@psf.upfronthosting.co.za> |
2009-02-17 10:06:33 | techtonik | link | issue5293 messages |
2009-02-17 10:06:32 | techtonik | create | |
|