@@ -103,24 +103,6 @@ open class SessionDelegate: NSObject {
103
103
/// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`.
104
104
open var downloadTaskDidResumeAtOffset : ( ( URLSession , URLSessionDownloadTask , Int64 , Int64 ) -> Void ) ?
105
105
106
- // MARK: URLSessionStreamDelegate Overrides
107
-
108
- #if !os(watchOS)
109
-
110
- /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`.
111
- open var streamTaskReadClosed : ( ( URLSession , URLSessionStreamTask ) -> Void ) ?
112
-
113
- /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`.
114
- open var streamTaskWriteClosed : ( ( URLSession , URLSessionStreamTask ) -> Void ) ?
115
-
116
- /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`.
117
- open var streamTaskBetterRouteDiscovered : ( ( URLSession , URLSessionStreamTask ) -> Void ) ?
118
-
119
- /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`.
120
- open var streamTaskDidBecomeInputAndOutputStreams : ( ( URLSession , URLSessionStreamTask , InputStream , OutputStream ) -> Void ) ?
121
-
122
- #endif
123
-
124
106
// MARK: Properties
125
107
126
108
var retrier : RequestRetrier ?
@@ -165,21 +147,6 @@ open class SessionDelegate: NSObject {
165
147
}
166
148
#endif
167
149
168
- #if !os(watchOS)
169
- switch selector {
170
- case #selector( URLSessionStreamDelegate . urlSession ( _: readClosedFor: ) ) :
171
- return streamTaskReadClosed != nil
172
- case #selector( URLSessionStreamDelegate . urlSession ( _: writeClosedFor: ) ) :
173
- return streamTaskWriteClosed != nil
174
- case #selector( URLSessionStreamDelegate . urlSession ( _: betterRouteDiscoveredFor: ) ) :
175
- return streamTaskBetterRouteDiscovered != nil
176
- case #selector( URLSessionStreamDelegate . urlSession ( _: streamTask: didBecome: outputStream: ) ) :
177
- return streamTaskDidBecomeInputAndOutputStreams != nil
178
- default :
179
- break
180
- }
181
- #endif
182
-
183
150
switch selector {
184
151
case #selector( URLSessionDelegate . urlSession ( _: didBecomeInvalidWithError: ) ) :
185
152
return sessionDidBecomeInvalidWithError != nil
@@ -632,50 +599,3 @@ extension SessionDelegate: URLSessionDownloadDelegate {
632
599
}
633
600
}
634
601
}
635
-
636
- // MARK: - URLSessionStreamDelegate
637
-
638
- #if !os(watchOS)
639
-
640
- extension SessionDelegate : URLSessionStreamDelegate {
641
- /// Tells the delegate that the read side of the connection has been closed.
642
- ///
643
- /// - parameter session: The session.
644
- /// - parameter streamTask: The stream task.
645
- open func urlSession( _ session: URLSession , readClosedFor streamTask: URLSessionStreamTask ) {
646
- streamTaskReadClosed ? ( session, streamTask)
647
- }
648
-
649
- /// Tells the delegate that the write side of the connection has been closed.
650
- ///
651
- /// - parameter session: The session.
652
- /// - parameter streamTask: The stream task.
653
- open func urlSession( _ session: URLSession , writeClosedFor streamTask: URLSessionStreamTask ) {
654
- streamTaskWriteClosed ? ( session, streamTask)
655
- }
656
-
657
- /// Tells the delegate that the system has determined that a better route to the host is available.
658
- ///
659
- /// - parameter session: The session.
660
- /// - parameter streamTask: The stream task.
661
- open func urlSession( _ session: URLSession , betterRouteDiscoveredFor streamTask: URLSessionStreamTask ) {
662
- streamTaskBetterRouteDiscovered ? ( session, streamTask)
663
- }
664
-
665
- /// Tells the delegate that the stream task has been completed and provides the unopened stream objects.
666
- ///
667
- /// - parameter session: The session.
668
- /// - parameter streamTask: The stream task.
669
- /// - parameter inputStream: The new input stream.
670
- /// - parameter outputStream: The new output stream.
671
- open func urlSession(
672
- _ session: URLSession ,
673
- streamTask: URLSessionStreamTask ,
674
- didBecome inputStream: InputStream ,
675
- outputStream: OutputStream )
676
- {
677
- streamTaskDidBecomeInputAndOutputStreams ? ( session, streamTask, inputStream, outputStream)
678
- }
679
- }
680
-
681
- #endif
0 commit comments