#4700 enhancement new
make it easier to proxy things (specifically transports and protocols)
|Reported by:||glyph||Owned by:|
As per #4699, without ClientFactory.clientConnectionLost, it's tricky to write a reconnecting client factory with endpoints because you have to write a factory which wraps its protocol to catch connectionLost, and doing that is tricky.
I think that the only really confusing issue is that the proxy needs to accurately relay whether or not its wrapped protocol provides IHalfCloseableProtocol or not, but whatever the confusion is, there should be one right way to write a dynamic proxy that just overrides a few methods, so that implementors don't need to be concerned with this sort of thing.
Specifically in the case of transports and protocols, it may also be helpful to dis-intermediate the proxy as much as possible, so that the implementor doesn't need to worry about using a proxy to catch one method slowing down every other possible method. But again, optimizing this is very confusing and hard to get really right, so there should be one central implementation of it.