sock.setblocking(0)
self.sock.connect((server, port))
(sread, swrite, serror) = select.select([], [self.sock], [], 10)
if swrite.count(self.sock) > 0:
i = self.sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
if 0 == i:
self.sock.setblocking(1)
--
Helge
this is a server at work that
gives me some account information, so when i want to check "several
hundred" accounts i need to look them up one by one since the server
closes the connection after each query.
--
Helge Aksdal
--
http://mail.python.org/mailman/listinfo/python-list
't ask about multiple accounts.
--
Helge Aksdal
--
http://mail.python.org/mailman/listinfo/python-list
be solved, if i just could get my socket code to
follow the redirection, as i tried to explain in my first email.
any tips? or do i have to use good old nasty time.sleep to avoid this?
--
Helge Aksdal
--
http://mail.python.org/mailman/listinfo/python-list
time.sleep(random.uniform(min_pause, max_pause))
> . do_connection_and_query_stuff()
>
> It works for me. Just play with the pause parameters until it fails
> and add a little.
thanks for the tip. i'll give that a shot.
--
Helge Aksdal
--
http://mail.python.org/mailman/listinfo/python-list
time.sleep(random.uniform(min_pause, max_pause))
> . do_connection_and_query_stuff()
>
> It works for me. Just play with the pause parameters until it fails
> and add a little.
thanks, this worked for me too. slows down the program, but at least
it works. :)
--
Helge Aksdal
--
h