Required Instance Methodswift-nio 2.72.0NIOCore
withUnsafeFileDescriptor(_:)
Will be called with the file descriptor if still open, if not it will throw an IOError
.
func withUnsafeFileDescriptor<T>(_ body: (CInt) throws -> T) throws -> T
Parameters
- body
The closure to execute if the
FileDescriptor
is still open.
Throws
If either the FileDescriptor
was closed before or the closure throws by itself.
The ownership of the file descriptor must not escape the body
as it’s completely managed by the implementation of the FileDescriptor
protocol.
Other requirements
Instance members
var isOpen: Bool
true
if thisFileDescriptor
is open (which means it was not closed yet).func close(
) throws Close this
FileDescriptor
.