---
title: CFSocketGetDefaultNameRegistryPortNumber()
framework: corefoundation
role: symbol
role_heading: Function
path: corefoundation/cfsocketgetdefaultnameregistryportnumber()
---

# CFSocketGetDefaultNameRegistryPortNumber()

Returns the default port number with which to connect to a CFSocket name server.

## Declaration

```swift
func CFSocketGetDefaultNameRegistryPortNumber() -> UInt16
```

## Return Value

Return Value The default port number with which to connect to a CFSocket name server.

## Discussion

Discussion If you do not provide a name server signature or leave out the socket address in the signature when calling one of the name registry functions, such as CFSocketRegisterSocketSignature(_:_:_:_:), the returned port number is used for the connection.

## See Also

### Core Foundation Socket Name Server Utilities Miscellaneous Functions

- [CFSocketCopyRegisteredSocketSignature(_:_:_:_:_:)](corefoundation/cfsocketcopyregisteredsocketsignature(_:_:_:_:_:).md)
- [CFSocketCopyRegisteredValue(_:_:_:_:_:)](corefoundation/cfsocketcopyregisteredvalue(_:_:_:_:_:).md)
- [CFSocketRegisterSocketSignature(_:_:_:_:)](corefoundation/cfsocketregistersocketsignature(_:_:_:_:).md)
- [CFSocketRegisterValue(_:_:_:_:)](corefoundation/cfsocketregistervalue(_:_:_:_:).md)
- [CFSocketSetDefaultNameRegistryPortNumber(_:)](corefoundation/cfsocketsetdefaultnameregistryportnumber(_:).md)
- [CFSocketUnregister(_:_:_:)](corefoundation/cfsocketunregister(_:_:_:).md)
