twisted.internet.test.test_tcp.TCPPortTestsMixin(object)
class documentationtwisted.internet.test.test_tcp
(View In Hierarchy)
Known subclasses: twisted.internet.test.test_tcp.TCPFDPortTestsBuilder, twisted.internet.test.test_tcp.TCPPortTestsBuilder
Tests for IReactorTCP.listenTCP
Method | getExpectedStartListeningLogMessage | Get the message expected to be logged when a TCP port starts listening. |
Method | getExpectedConnectionLostLogMsg | Get the expected connection lost message for a TCP port. |
Method | test_portGetHostOnIPv4 | When no interface is passed to IReactorTCP.listenTCP ,
the returned listening port listens on an IPv4 address. |
Method | test_portGetHostOnIPv6 | When listening on an IPv6 address, IListeningPort.getHost
returns an IPv6Address
with host and port attributes reflecting the
address the port is bound to. |
Method | test_portGetHostOnIPv6ScopeID | No summary |
Method | test_buildProtocolIPv4Address | When a connection is accepted over IPv4, an IPv4Address
is passed to the factory's buildProtocol method giving the
peer's address. |
Method | test_buildProtocolIPv6Address | When a connection is accepted to an IPv6 address, an IPv6Address
is passed to the factory's buildProtocol method giving the
peer's address. |
Method | test_buildProtocolIPv6AddressScopeID | When a connection is accepted to a link-local IPv6 address, an IPv6Address
is passed to the factory's buildProtocol method giving the
peer's address, including a scope identifier. |
Method | test_serverGetHostOnIPv4 | When a connection is accepted over IPv4, the server ITransport.getHost
method returns an IPv4Address
giving the address on which the server accepted the connection. |
Method | test_serverGetHostOnIPv6 | When a connection is accepted over IPv6, the server ITransport.getHost
method returns an IPv6Address
giving the address on which the server accepted the connection. |
Method | test_serverGetHostOnIPv6ScopeID | No summary |
Method | test_serverGetPeerOnIPv4 | When a connection is accepted over IPv4, the server ITransport.getPeer
method returns an IPv4Address
giving the address of the remote end of the connection. |
Method | test_serverGetPeerOnIPv6 | When a connection is accepted over IPv6, the server ITransport.getPeer
method returns an IPv6Address
giving the address on the remote end of the connection. |
Method | test_serverGetPeerOnIPv6ScopeID | No summary |
Method | _buildProtocolAddressTest | Connect client to a server listening on
interface started with IReactorTCP.listenTCP
and return the address passed to the factory's buildProtocol
method. |
Method | _serverGetConnectionAddressTest | Connect client to a server listening on
interface started with IReactorTCP.listenTCP
and return the address returned by one of the server transport's address
lookup methods, getHost or getPeer . |
Get the message expected to be logged when a TCP port starts listening.
Get the expected connection lost message for a TCP port.
When no interface is passed to IReactorTCP.listenTCP
,
the returned listening port listens on an IPv4 address.
When listening on an IPv6 address, IListeningPort.getHost
returns an IPv6Address
with host
and port
attributes reflecting the
address the port is bound to.
When a link-local IPv6 address including a scope identifier is passed as
the interface
argument to IReactorTCP.listenTCP
,
the resulting IListeningPort
reports its address as an IPv6Address
with a host value that includes the scope identifier.
Connect client
to a server listening on
interface
started with IReactorTCP.listenTCP
and return the address passed to the factory's buildProtocol
method.
Parameters | client | A SOCK_STREAM socket.socket
created with an address family such that it will be able to connect to a
server listening on interface . |
interface | A str giving an address for a server to listen on. This should
almost certainly be the loopback address for some address family supported
by IReactorTCP.listenTCP . | |
Returns | Whatever object, probably an IAddress
provider, is passed to a server factory's buildProtocol method
when client establishes a connection. |
When a connection is accepted over IPv4, an IPv4Address
is passed to the factory's buildProtocol
method giving the
peer's address.
When a connection is accepted to an IPv6 address, an IPv6Address
is passed to the factory's buildProtocol
method giving the
peer's address.
When a connection is accepted to a link-local IPv6 address, an IPv6Address
is passed to the factory's buildProtocol
method giving the
peer's address, including a scope identifier.
Connect client
to a server listening on
interface
started with IReactorTCP.listenTCP
and return the address returned by one of the server transport's address
lookup methods, getHost
or getPeer
.
Parameters | client | A SOCK_STREAM socket.socket
created with an address family such that it will be able to connect to a
server listening on interface . |
interface | A str giving an address for a server to listen on. This should
almost certainly be the loopback address for some address family supported
by IReactorTCP.listenTCP . | |
which | A str equal to either "getHost" or
"getPeer" determining which address will be
returned. | |
Returns | Whatever object, probably an IAddress
provider, is returned from the method indicated by which . |
When a connection is accepted over IPv4, the server ITransport.getHost
method returns an IPv4Address
giving the address on which the server accepted the connection.
When a connection is accepted over IPv6, the server ITransport.getHost
method returns an IPv6Address
giving the address on which the server accepted the connection.
When a connection is accepted over IPv6, the server ITransport.getHost
method returns an IPv6Address
giving the address on which the server accepted the connection, including
the scope identifier.
When a connection is accepted over IPv4, the server ITransport.getPeer
method returns an IPv4Address
giving the address of the remote end of the connection.
When a connection is accepted over IPv6, the server ITransport.getPeer
method returns an IPv6Address
giving the address on the remote end of the connection.
When a connection is accepted over IPv6, the server ITransport.getPeer
method returns an IPv6Address
giving the address on the remote end of the connection, including the scope
identifier.