diff --git a/docs/state-machines/_connection.dot b/docs/state-machines/_connection.dot index 5fd6c52..3101f18 100644 --- a/docs/state-machines/_connection.dot +++ b/docs/state-machines/_connection.dot @@ -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 */ diff --git a/src/wormhole/_rendezvous.py b/src/wormhole/_rendezvous.py index 63cea71..0806495 100644 --- a/src/wormhole/_rendezvous.py +++ b/src/wormhole/_rendezvous.py @@ -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):