---
title: "CFMessagePortSetName(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfmessageportsetname(_:_:)"
---

# CFMessagePortSetName(_:_:)

Sets the name of a local CFMessagePort object.

## Declaration

```swift
func CFMessagePortSetName(_ ms: CFMessagePort!, _ newName: CFString!) -> Bool
```

## Parameters

- `ms`: The local message port to examine.
- `newName`: The new name for ms.

## Return Value

Return Value true if the name change succeeds, otherwise false.

## Discussion

Discussion Other threads and processes can connect to a named message port with CFMessagePortCreateRemote(_:_:).

## See Also

### Configuring a CFMessagePort Object

- [CFMessagePortCreateRunLoopSource(_:_:_:)](corefoundation/cfmessageportcreaterunloopsource(_:_:_:).md)
- [CFMessagePortSetInvalidationCallBack(_:_:)](corefoundation/cfmessageportsetinvalidationcallback(_:_:).md)
