---
title: disconnectOnSleep
framework: networkextension
role: symbol
role_heading: Instance Property
path: networkextension/nevpnprotocol/disconnectonsleep
---

# disconnectOnSleep

A Boolean value that indicates whether the VPN disconnects when the device sleeps.

## Declaration

```swift
var disconnectOnSleep: Bool { get set }
```

## Discussion

Discussion The default value of this property is false.

## See Also

### Configuring the VPN

- [serverAddress](networkextension/nevpnprotocol/serveraddress.md)
- [proxySettings](networkextension/nevpnprotocol/proxysettings.md)
