@@ -134,17 +134,6 @@ open class FileHandle : NSObject, NSSecureCoding {
134
134
return source
135
135
}
136
136
137
- #if os(Windows)
138
- @available ( * , unavailable, message: " Not yet implemented on Windows " )
139
- open var readabilityHandler : ( ( FileHandle ) -> Void ) ? = {
140
- ( FileHandle) -> Void in NSUnimplemented ( )
141
- }
142
-
143
- @available ( * , unavailable, message: " Not yet implemented on Windows " )
144
- open var writeabilityHandler : ( ( FileHandle ) -> Void ) ? = {
145
- ( FileHandle) -> Void in NSUnimplemented ( )
146
- }
147
- #else
148
137
private var _readabilityHandler : ( ( FileHandle ) -> Void ) ? = nil // Guarded by privateAsyncVariablesLock
149
138
open var readabilityHandler : ( ( FileHandle ) -> Void ) ? {
150
139
get {
@@ -200,7 +189,6 @@ open class FileHandle : NSObject, NSSecureCoding {
200
189
}
201
190
}
202
191
}
203
- #endif
204
192
205
193
open var availableData : Data {
206
194
_checkFileHandle ( )
@@ -891,7 +879,11 @@ extension FileHandle {
891
879
acceptConnectionInBackgroundAndNotify ( forModes: [ . default] )
892
880
}
893
881
882
+ @available ( Windows, unavailable, message: " A SOCKET cannot be treated as a fd " )
894
883
open func acceptConnectionInBackgroundAndNotify( forModes modes: [ RunLoop . Mode ] ? ) {
884
+ #if os(Windows)
885
+ NSUnavailable ( )
886
+ #else
895
887
let owner = monitor ( forReading: true , resumed: false ) { ( handle, source) in
896
888
var notification = Notification ( name: . NSFileHandleConnectionAccepted, object: handle, userInfo: [ : ] )
897
889
let userInfo : [ AnyHashable : Any ]
@@ -919,6 +911,7 @@ extension FileHandle {
919
911
privateAsyncVariablesLock. unlock ( )
920
912
921
913
owner. resume ( )
914
+ #endif
922
915
}
923
916
924
917
open func waitForDataInBackgroundAndNotify( ) {
0 commit comments