---
title: kCFStreamPropertyShouldCloseNativeSocket
framework: corefoundation
role: symbol
role_heading: Global Variable
path: corefoundation/kcfstreampropertyshouldclosenativesocket
---

# kCFStreamPropertyShouldCloseNativeSocket

Should Close Native Socket property key.

## Declaration

```swift
let kCFStreamPropertyShouldCloseNativeSocket: CFString
```

## Discussion

Discussion If set to kCFBooleanTrue, the stream will close and release the underlying native socket when the stream is released. If set to kCFBooleanFalse, the stream will not close and release the underlying native socket when the stream is released. If a stream is created with a native socket, the default value of this property is kCFBooleanFalse. This property is only available for socket streams. It can be set by calling CFReadStreamSetProperty(_:_:_:) and CFWriteStreamSetProperty(_:_:_:), and it can be copied by CFReadStreamCopyProperty(_:_:) and CFWriteStreamCopyProperty(_:_:).

## See Also

### Constants

- [appendToFile](corefoundation/cfstreampropertykey/appendtofile.md)
- [dataWritten](corefoundation/cfstreampropertykey/datawritten.md)
- [fileCurrentOffset](corefoundation/cfstreampropertykey/filecurrentoffset.md)
- [socketNativeHandle](corefoundation/cfstreampropertykey/socketnativehandle.md)
- [socketRemoteHostName](corefoundation/cfstreampropertykey/socketremotehostname.md)
- [socketRemotePortNumber](corefoundation/cfstreampropertykey/socketremoteportnumber.md)
- [kCFStreamPropertySocketSecurityLevel](corefoundation/kcfstreampropertysocketsecuritylevel.md)
- [kCFStreamPropertySSLPeerCertificates](cfnetwork/kcfstreampropertysslpeercertificates.md)
- [kCFStreamPropertySSLPeerTrust](cfnetwork/kcfstreampropertysslpeertrust.md)
- [kCFStreamPropertySSLSettings](cfnetwork/kcfstreampropertysslsettings.md)
- [kCFStreamPropertySSLContext](cfnetwork/kcfstreampropertysslcontext.md)
- [kCFStreamPropertySOCKSProxy](corefoundation/kcfstreampropertysocksproxy.md)
- [kCFStreamPropertyProxyLocalBypass](cfnetwork/kcfstreampropertyproxylocalbypass.md)
- [kCFStreamPropertySocketRemoteHost](cfnetwork/kcfstreampropertysocketremotehost.md)
- [kCFStreamPropertySocketRemoteNetService](cfnetwork/kcfstreampropertysocketremotenetservice.md)
