def flushTwoTLSProtocols(self, tlsProtocol, serverTLSProtocol):
        # We want to make sure all bytes are passed back and forth; JP
        # estimated that 3 rounds should be enough:
        for i in range(3):
            clientData = tlsProtocol.transport.value()
            if clientData:
                serverTLSProtocol.dataReceived(clientData)
                tlsProtocol.transport.clear()
            serverData = serverTLSProtocol.transport.value()
            if serverData:
                tlsProtocol.dataReceived(serverData)
                serverTLSProtocol.transport.clear()
            if not serverData and not clientData:
                break
        self.assertEqual(tlsProtocol.transport.value(), "")
        self.assertEqual(serverTLSProtocol.transport.value(), "")
Transfer bytes back and forth between two TLS protocols.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/protocols/test/test_tls.py/TLSProducerTests.flushTwoTLSProtocols