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

# CFMessagePortIsValid(_:)

Returns a Boolean value that indicates whether a CFMessagePort object is valid and able to send or receive messages.

```
func CFMessagePortIsValid(_ ms: CFMessagePort!) -> Bool
```

## Parameters

`ms`

The message port to examine.

## Return Value

`true` if `ms` can be used for communication, otherwise `false`.

## Discussion

---

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)