Instance Method
close()
Closes the socket’s descriptor immediately.
func close() async
Mentioned In
Discussion
async for API symmetry with other methods; the underlying close(2) is synchronous. Safe to call even when ownsDescriptor == false — the caller is acknowledging ownership at call time. Subsequent I/O will fail with the appropriate errno-carrying error.