---
title: kCFSocketLeaveErrors
framework: corefoundation
role: symbol
role_heading: Global Variable
path: corefoundation/kcfsocketleaveerrors
---

# kCFSocketLeaveErrors

## Declaration

```swift
var kCFSocketLeaveErrors: CFOptionFlags { get }
```

## Discussion

Discussion Normally, the CFNetwork stack calls getsockopt(2) macOS Developer Tools Manual Page to read the error code from the socket prior to calling your write callback. This also has the effect of clearing any pending errors on the socket. If this flag is set, this call is skipped so that you can check for specific socket errors in your write callback.

## See Also

### Constants

- [kCFSocketAutomaticallyReenableReadCallBack](corefoundation/kcfsocketautomaticallyreenablereadcallback.md)
- [kCFSocketAutomaticallyReenableAcceptCallBack](corefoundation/kcfsocketautomaticallyreenableacceptcallback.md)
- [kCFSocketAutomaticallyReenableDataCallBack](corefoundation/kcfsocketautomaticallyreenabledatacallback.md)
- [kCFSocketAutomaticallyReenableWriteCallBack](corefoundation/kcfsocketautomaticallyreenablewritecallback.md)
- [kCFSocketCloseOnInvalidate](corefoundation/kcfsocketcloseoninvalidate.md)
