Be patient whilst connecting
On startup we make several connections simultaneously. Socket maintenance code checks if we're not connected, and if not switches to a connected interface if auto_connect. Unfortunately this meant that we frequently didn't reconnect to the prior good server on startup, because some other connection would happen first and this code would decide to switch to it. Instead, only switch if a connection attempt is not in progress. If that times out at the O/S level the switch will happen.
This commit is contained in:
parent
f5a43b8738
commit
da5c18b2f9
|
@ -642,7 +642,8 @@ class Network(util.DaemonThread):
|
|||
# main interface
|
||||
if not self.is_connected():
|
||||
if self.auto_connect:
|
||||
self.switch_to_random_interface()
|
||||
if not self.is_connecting():
|
||||
self.switch_to_random_interface()
|
||||
else:
|
||||
if self.default_server in self.disconnected_servers:
|
||||
if now - self.server_retry_time > SERVER_RETRY_INTERVAL:
|
||||
|
|
Loading…
Reference in New Issue