<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/kCFSocketLeaveErrors",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@Ea@kCFSocketAutomaticallyReenableReadCallBack@kCFSocketLeaveErrors"
  },
  "title" : "kCFSocketLeaveErrors"
}
-->

# kCFSocketLeaveErrors

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

## 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.

---

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)