New submission from anatoly techtonik <[email protected]>:

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.

----------
components: Library (Lib), Windows
messages: 82311
nosy: techtonik
severity: normal
status: open
title: socket timeouts even in blocking mode
versions: Python 2.5

_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue5293>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to