mirror of
https://github.com/apple/swift-nio
synced 2026-11-28 05:14:23 +00:00
NIO: invalid sockets are not -1 but INVALID_SOCKET (#1660)
Adjust the sentinel indicating an invalid socket. Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
1 parent
bc328cd3a8
commit
0ae9524ca8
1 file changed
+4
@@ -475,7 +475,11 @@ class BaseSocket: BaseSocketProtocol {
|
||||
/// - throws: An `IOError` if the operation failed.
|
||||
final func takeDescriptorOwnership() throws -> NIOBSDSocket.Handle {
|
||||
return try self.withUnsafeHandle {
|
||||
#if os(Windows)
|
||||
self.descriptor = INVALID_SOCKET
|
||||
#else
|
||||
self.descriptor = -1
|
||||
#endif
|
||||
return $0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user