---
title: "registerPort:name:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmachbootstrapserver/registerport:name:"
---

# registerPort:name:

Registers a port with a specified name.

## Declaration

```occ
- (BOOL) registerPort:(NSPort *) port name:(NSString *) name;
```

## Parameters

- `port`: The port object to register with the bootstrap server.
- `name`: The name to associate with port.

## Return Value

Return Value true if the registration succeeded, false otherwise.

## Discussion

Discussion Once registered, a port cannot be unregistered; instead, you need to invalidate the port.
