<!--
{
  "availability" : [

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

# close()

Closes the listening file descriptor immediately.

```
func close()
```

## Discussion

Safe to call multiple times — the kernel will return `EBADF` on the second
`close(2)`, which this wrapper ignores. Subsequent [`accept()`](/documentation/Event/ServerSocket/accept()) calls will fail
with [`SocketError.acceptFailed(_:)`](/documentation/Event/SocketError/acceptFailed(_:)).