---
title: "CFMessagePortIsValid(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfmessageportisvalid(_:)"
---

# CFMessagePortIsValid(_:)

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

## Declaration

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

## Parameters

- `ms`: The message port to examine.

## Return Value

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

## See Also

### Examining a Message Port

- [CFMessagePortGetContext(_:_:)](corefoundation/cfmessageportgetcontext(_:_:).md)
- [CFMessagePortGetInvalidationCallBack(_:)](corefoundation/cfmessageportgetinvalidationcallback(_:).md)
- [CFMessagePortGetName(_:)](corefoundation/cfmessageportgetname(_:).md)
- [CFMessagePortIsRemote(_:)](corefoundation/cfmessageportisremote(_:).md)
