---
title: "servicePortWithName:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmachbootstrapserver/serviceportwithname:"
---

# servicePortWithName:

Looks up and returns the port for the vended service that is registered under the specified name.

## Declaration

```occ
- (NSPort *) servicePortWithName:(NSString *) name;
```

## Parameters

- `name`: The name of the vended service.

## Return Value

Return Value The port associated with name. Returns nil if no such port exists.

## See Also

### Looking up Ports

- [portForName:](foundation/nsmachbootstrapserver/portforname:.md)
- [portForName:host:](foundation/nsmachbootstrapserver/portforname:host:.md)
