Mentioned In
Overview
SocketError is the sole error type thrown by the idiomatic Event API for TCP I/O and address parsing. Every case carries either a user-supplied string (for input-validation failures) or the raw errno value captured at the point of failure, so callers can disambiguate transient conditions (e.g. EINPROGRESS, EAGAIN) from permanent failures (e.g. ECONNREFUSED).
Interpreting the errno payload
The Int32 payload attached to .connectionFailed, .bindFailed, .listenFailed, .acceptFailed, .readFailed, .writeFailed, and .socketCreationFailed is the value of errno immediately after the failing connect(2) / bind(2) / listen(2) / accept(2) / read(2) / write(2) / socket(2) syscall. It is not a POSIX abstraction — it is the platform’s raw errno. To render a human-readable string, pass it through strerror(_:); the default errorDescription does this for you.
When each case is thrown
See Also
Production Considerations for the current caveat list, including behaviors not yet wrapped (UDP, TLS, timeouts, cancellation).
Topics
Enumeration Cases