<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 12.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWListener/State-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network10NWListenerC5StateO"
  },
  "title" : "NWListener.State"
}
-->

# NWListener.State

States indicating whether a listener is able to accept incoming connections.

```
enum State
```

## Topics

### States

[`NWListener.State.setup`](/documentation/Network/NWListener/State-swift.enum/setup)

The listener has been initialized but not started.

[`NWListener.State.waiting(_:)`](/documentation/Network/NWListener/State-swift.enum/waiting(_:))

The listener is waiting for a network to become available.

[`NWListener.State.ready`](/documentation/Network/NWListener/State-swift.enum/ready)

The listener is running and able to receive incoming connections.

[`NWListener.State.failed(_:)`](/documentation/Network/NWListener/State-swift.enum/failed(_:))

The listener has encountered a fatal error.

[`NWListener.State.cancelled`](/documentation/Network/NWListener/State-swift.enum/cancelled)

The listener has been canceled.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)