reminder how ConnectionService should fail if first attempt fails

This commit is contained in:
Brian Warner 2017-03-03 05:37:41 -08:00
parent fcdcf30ba8
commit 9a2d992815
2 changed files with 16 additions and 0 deletions

View File

@ -1,4 +1,19 @@
digraph {
/* note: this is nominally what we want from the machine that
establishes the WebSocket connection (and re-establishes it when it
is lost). We aren't using this yet; for now we're relying upon
twisted.application.internet.ClientService, which does reconnection
and random exponential backoff.
The one thing it doesn't do is fail entirely when the first
connection attempt fails, which I think would be good for usability.
If the first attempt fails, it's probably because you don't have a
network connection, or the hostname is wrong, or the service has
been retired entirely. And retrying silently forever is not being
honest with the user.
So I'm keeping this diagram around, as a reminder of how we'd like
to modify ClientService. */
/* ConnectionMachine */

View File

@ -78,6 +78,7 @@ class RendezvousConnector(object):
f.setProtocolOptions(autoPingInterval=60, autoPingTimeout=600)
p = urlparse(self._url)
ep = self._make_endpoint(p.hostname, p.port or 80)
# TODO: change/wrap ClientService to fail if the first attempt fails
self._connector = internet.ClientService(ep, f)
def set_trace(self, f):