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.getHostreturns anIPv6Addresswithhostandportattributes reflecting the 
address the port is bound to. | 
| Method | test_portGetHostOnIPv6ScopeID | No summary | 
| Method | test_buildProtocolIPv4Address | When a connection is accepted over IPv4, an IPv4Addressis passed to the factory'sbuildProtocolmethod giving the 
peer's address. | 
| Method | test_buildProtocolIPv6Address | When a connection is accepted to an IPv6 address, an IPv6Addressis passed to the factory'sbuildProtocolmethod giving the 
peer's address. | 
| Method | test_buildProtocolIPv6AddressScopeID | When a connection is accepted to a link-local IPv6 address, an IPv6Addressis passed to the factory'sbuildProtocolmethod giving the 
peer's address, including a scope identifier. | 
| Method | test_serverGetHostOnIPv4 | When a connection is accepted over IPv4, the server ITransport.getHostmethod returns anIPv4Addressgiving the address on which the server accepted the connection. | 
| Method | test_serverGetHostOnIPv6 | When a connection is accepted over IPv6, the server ITransport.getHostmethod returns anIPv6Addressgiving 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.getPeermethod returns anIPv4Addressgiving the address of the remote end of the connection. | 
| Method | test_serverGetPeerOnIPv6 | When a connection is accepted over IPv6, the server ITransport.getPeermethod returns anIPv6Addressgiving the address on the remote end of the connection. | 
| Method | test_serverGetPeerOnIPv6ScopeID | No summary | 
| Method | _buildProtocolAddressTest | Connect clientto a server listening oninterfacestarted withIReactorTCP.listenTCPand return the address passed to the factory'sbuildProtocolmethod. | 
| Method | _serverGetConnectionAddressTest | Connect clientto a server listening oninterfacestarted withIReactorTCP.listenTCPand return the address returned by one of the server transport's address 
lookup methods,getHostorgetPeer. | 
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_STREAMsocket.socketcreated with an address family such that it will be able to connect to a 
server listening oninterface. | 
| interface | A strgiving an address for a server to listen on. This should
almost certainly be the loopback address for some address family supported 
byIReactorTCP.listenTCP. | |
| Returns | Whatever object, probably an IAddressprovider, is passed to a server factory'sbuildProtocolmethod
whenclientestablishes 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_STREAMsocket.socketcreated with an address family such that it will be able to connect to a 
server listening oninterface. | 
| interface | A strgiving an address for a server to listen on. This should
almost certainly be the loopback address for some address family supported 
byIReactorTCP.listenTCP. | |
| which | A strequal to either"getHost"or"getPeer"determining which address will be 
returned. | |
| Returns | Whatever object, probably an IAddressprovider, is returned from the method indicated bywhich. | |
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.