Message17327
| Author |
johnjsmith |
| Recipients |
| Date |
2003年07月29日.12:49:18 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=830565
I was bitten by the same problem. My workaround (in a
Tkinter application) is given below.
Would it make sense to modify poll() to simply add the union
of r and w to e, and call handle_error() for any fd in e?
Workaround:
try:
self.connect(send_addr)
except socket.error:
self.handle_error()
if sys.platform == 'win32':
# Win98 select() doesn't seem to report errors for a
# non-blocking connect().
self.__connected = 0
self.__frame.after(2000, self.__win_connect_poll)
...
if sys.platform == 'win32':
def __win_connect_poll (self):
if self.__connected:
return
e = self.socket.getsockopt(socket.SOL_SOCKET,
socket.SO_ERROR)
if e in (0, errno.EINPROGRESS,
errno.WSAEINPROGRESS):
self.__frame.after(2000, self.__win_connect_poll)
else:
try:
str = socket.errorTab[e]
except KeyError:
str = os.strerror(e)
try:
raise socket.error(e, str)
except socket.error:
self.handle_error()
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:15:19 | admin | link | issue777588 messages |
| 2007年08月23日 14:15:19 | admin | create |
|