NIO: remove `poll` from the `_BSDSocketProtocol` protocol (#1635)

This removes the testing-only API of `poll` on Windows which does not
have a semantic compatible poll.

Co-authored-by: David Evans <d.evans@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
Saleem Abdulrasool 2020-09-21 02:31:13 -07:00 committed by GitHub
parent 0c2789c56a
commit f7dc232e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -431,9 +431,15 @@ protocol _BSDSocketProtocol {
size: size_t,
offset: off_t) throws -> IOResult<size_t>
static func poll(fds: UnsafeMutablePointer<pollfd>,
nfds: nfds_t,
#if !os(Windows)
// NOTE: We do not support this on Windows as WSAPoll behaves differently
// from poll with reporting of failed connections (Connect Report 309411),
// which recommended that you use NetAPI instead.
//
// This is safe to exclude as this is a testing-only API.
static func poll(fds: UnsafeMutablePointer<pollfd>, nfds: nfds_t,
timeout: CInt) throws -> CInt
#endif
static func inet_ntop(af family: NIOBSDSocket.AddressFamily,
src addr: UnsafeRawPointer,

View File

@ -275,13 +275,6 @@ extension NIOBSDSocket {
return .processed(CInt(nNumberOfBytesWritten))
}
@inline(never)
static func poll(fds: UnsafeMutablePointer<pollfd>,
nfds: nfds_t,
timeout: CInt) throws -> CInt {
fatalError("Poll unsupported on Windows")
}
@discardableResult
@inline(never)
static func inet_ntop(af family: NIOBSDSocket.AddressFamily,