<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Event",
  "identifier" : "/documentation/Event/Socket/close()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Event"
    ],
    "preciseIdentifier" : "s:5Event6SocketC5closeyyYaF"
  },
  "title" : "close()"
}
-->

# close()

Closes the socket’s descriptor immediately.

```
func close() async
```

## 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.