---
title: state
framework: networkextension
role: symbol
role_heading: Instance Property
path: networkextension/nwudpsession/state
---

# state

The current state of the UDP session.

## Declaration

```swift
var state: NWUDPSessionState { get }
```

## Discussion

Discussion Use Key-Value Observing (KVO) to monitor the state. If the state is NWUDPSessionStateReady, then the connection is eligible for reading and writing. The state will be NWUDPSessionStateFailed if the endpoint could not be resolved, or all endpoints have been rejected. For information about KVO, see Key-Value Observing Programming Guide.

## See Also

### Monitoring the session state

- [NWUDPSessionState](networkextension/nwudpsessionstate.md)
- [isViable](networkextension/nwudpsession/isviable.md)
