Extract common TCPTransport code into single method.