<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFSocketGetSocketFlags(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFSocketGetSocketFlags"
  },
  "title" : "CFSocketGetSocketFlags(_:)"
}
-->

# CFSocketGetSocketFlags(_:)

Returns flags that control certain behaviors of a CFSocket object.

```
func CFSocketGetSocketFlags(_ s: CFSocket!) -> CFOptionFlags
```

## Parameters

`s`

The CFSocket to examine.

## Return Value

A bitwise-OR combination of flags controlling the behavior of `s`. See [CFSocket Flags](/documentation/CoreFoundation/1560944-cfsocket-flags) for the list of available flags.

## Discussion

See [`CFSocketSetSocketFlags(_:_:)`](/documentation/CoreFoundation/CFSocketSetSocketFlags(_:_:)) for details on what the flags of a CFSocket mean.

---

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)