Github user dmap commented on the issue:
https://github.com/apache/httpcomponents-core/pull/94
@ok2c I have spent several hours looking at refactoring
`InternalDataChannel` to achieve what we want... it is possible but I think the
result will be worse than what we have with the `InternalConnectSocksChannel`.
The problem is that we need to delay several actions (the completion of the
`IOSessionRequest` currently in `InternalConnectChannel` and the triggering of
the `connected` call on the `IOEventHandler` in `InternalDataChannel`) that are
triggered upon the establishment of the connection until after the SOCKS
protocol negotiation is complete. In order to do this we either need to put a
bunch of special case logic into `InternalDataChannel` just for SOCKS or invent
some mechanism to allow the `IOEventHandler` to signal the connection has been
made. But that feels backwards, the `IOEventHandler` currently gets told when
the connection is established, not the other way around. It seems awkward to
change this just to implement SOCKS, and I can't imagine any future use cas
es. SOCKS is somewhat unique in that it is purely a connection time
enhancement. Basically everything else, even SSL or HTTP/2 etc is a protocol
on top of an established TCP/IP connection.
I'm not trying to be difficult but after spending some time on it I
honestly feel the `InternalConnectSocksChannel` is the better way. As you have
observed the implementation is nicely contained in one place and cleanly
integrated into the existing framework.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]