         }
     }
 
-    private func getConnection() throws -> Connection {
-        if let connection = self.connection {
-            return connection
-        }
-
-        let connection: Connection
+    private func getStream() throws -> Stream {
+        if let stream = self.stream {
+            return stream
+        }
+
+        let stream: Stream
 
         if secure {
-            connection = try TCPTLSConnection(
+            stream = try TCPTLSStream(
                 host: host,
                 port: port,
                 verifyBundle: verifyBundle,

import Foundation

public enum HTTPClientError : Error {
    case invalidURIScheme
    case uriHostRequired

        var request = request
        addHeaders(to: &request)

        let stream = try getStream()
        let serializer = getSerializer(stream: stream)
        let parser = getParser()

        self.stream = stream
        self.serializer = serializer
        self.parser = parser

