<!--
{
  "availability" : [
    "iOS: 9.0.0 - 18.0.0",
    "iPadOS: 9.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.11.0 - 15.0.0",
    "tvOS: 17.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NWTCPConnectionState",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:@E@NWTCPConnectionState"
  },
  "title" : "NWTCPConnectionState"
}
-->

# NWTCPConnectionState

Defined connection states. New types may be defined in the future.

```
enum NWTCPConnectionState
```

## Topics

### Connection States

[`NWTCPConnectionStateInvalid`](/documentation/NetworkExtension/NWTCPConnectionState/invalid)

The connection is in an invalid or uninitialized state.

[`NWTCPConnectionStateConnecting`](/documentation/NetworkExtension/NWTCPConnectionState/connecting)

The connection is attempting to connect. This includes endpoint resolution when applicable.

[`NWTCPConnectionStateWaiting`](/documentation/NetworkExtension/NWTCPConnectionState/waiting)

The connection has attempted to connect but failed. It is now waiting for better conditions before trying again.

[`NWTCPConnectionStateConnected`](/documentation/NetworkExtension/NWTCPConnectionState/connected)

The connection is established. It is now possible to transfer data. If TLS is in use, the TLS handshake has finished.

[`NWTCPConnectionStateDisconnected`](/documentation/NetworkExtension/NWTCPConnectionState/disconnected)

The connection is disconnected. It is no longer possible to transfer data. The application should call `cancel` to clean up resources.

[`NWTCPConnectionStateCancelled`](/documentation/NetworkExtension/NWTCPConnectionState/cancelled)

The connection has been cancelled by the client calling `cancel`.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)