On Wed, 18 Dec 2013 03:16:47 -0800 Glyph <[email protected]> wrote: > > So it *is* transport-specific already. > > No, it's protocol-specific. If it were "transport-specific" that would mean > that it would make sense to reconnect all TCP connections, for example.
You misunderstood what I said. It is transport-specific because you must examine the specific reasons for disconnection before deciding whether to reconnect or not. > > Actually, the general pattern may be to call self.transport.reconnect() > > from the protocol's connection_lost(). > > If you need to do something in connection_lost anyway, then why not just call > create_connection again yourself? Because you don't know the connection parameters from inside the protocol. It's irrational to ask the protocol to know about the connection parameters when the whole point of protocols is to be decoupled from transport and connection characteristics. Regards Antoine.
