|
@@ -393,3 +393,39 @@ public func upload(
|
|
|
encodingCompletion: encodingCompletion
|
|
encodingCompletion: encodingCompletion
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+#if !os(watchOS)
|
|
|
|
|
+
|
|
|
|
|
+// MARK: - Stream Request
|
|
|
|
|
+
|
|
|
|
|
+// MARK: Hostname and Port
|
|
|
|
|
+
|
|
|
|
|
+/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname`
|
|
|
|
|
+/// and `port`.
|
|
|
|
|
+///
|
|
|
|
|
+/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
|
|
|
|
|
+///
|
|
|
|
|
+/// - parameter hostName: The hostname of the server to connect to.
|
|
|
|
|
+/// - parameter port: The port of the server to connect to.
|
|
|
|
|
+///
|
|
|
|
|
+/// - returns: The created `StreamRequest`.
|
|
|
|
|
+@discardableResult
|
|
|
|
|
+public func stream(withHostName hostName: String, port: Int) -> StreamRequest {
|
|
|
|
|
+ return SessionManager.default.stream(withHostName: hostName, port: port)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// MARK: NetService
|
|
|
|
|
+
|
|
|
|
|
+/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`.
|
|
|
|
|
+///
|
|
|
|
|
+/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned.
|
|
|
|
|
+///
|
|
|
|
|
+/// - parameter netService: The net service used to identify the endpoint.
|
|
|
|
|
+///
|
|
|
|
|
+/// - returns: The created `StreamRequest`.
|
|
|
|
|
+@discardableResult
|
|
|
|
|
+public func stream(with netService: NetService) -> StreamRequest {
|
|
|
|
|
+ return SessionManager.default.stream(with: netService)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#endif
|