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:
parent
0c2789c56a
commit
f7dc232e0c
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue