[Twisted-Python] Does anyone need / make use of SSHTransportAddress introduced in 12.1 ?

Adi Roiban adi at roiban.ro
Tue Mar 17 07:44:39 MDT 2015


Hi,

While trying to fix https://twistedmatrix.com/trac/ticket/5999 I found
out about the SSHTransportAddress introduced in 12.1.

SSHTransportAddress is just an IAddress wrapping in a non-tranparent
way another IAddress.

It was introduces in #2997 which was accepted without any reason why
we need SSHTransportAddress and why SSHTransportAddress is better than
an IAddress.
I could not find any documentation describing why we need this new class.

In case I have not got this wrong, exarkun argued that we need
SSHTransportAddress in order to find out the type of transport in use
https://twistedmatrix.com/trac/ticket/5999#comment:11

I find it stupid to use transport.getHost() and transport.getPeer() to
find out what transport you have rather than doing a check on the
transport itself.

# I am for this check
if IConchTransport.providedBy(someTransport):
    pass

# rather this one.
if isinstance(someTransport.getHost(), SSHTransportAddress):
    pass

I understand the need for endpoints but has somebody implemented an
endpoint which reads an SSHTransportAddress?

Am I the only one who fails to see the advantages of using
SSHTransportAddress over a normal IAddress?

Thanks!
-- 
Adi Roiban



More information about the Twisted-Python mailing list