Next Page > Hide TOC

NSMachBootstrapServer Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSPortNameServer.h

Overview

This port name server takes and returns instances of NSMachPort.

Port removal functionality is not supported in NSMachBootstrapServer; if you want to cancel a service, you have to destroy the port (invalidate the NSMachPort given to registerPort:name:).

Tasks

Getting the Server Object

Looking Up Ports

Registering Ports

Class Methods

sharedInstance

Returns the shared instance of the bootstrap server.

+ (id)sharedInstance

Return Value

The shared instance of NSMachBootstrapServer with which you register and look up NSMachPort objects.

Availability
Declared In
NSPortNameServer.h

Instance Methods

portForName:

Looks up and returns the port registered under the specified name on the local host.

- (NSPort *)portForName:(NSString *)portName

Parameters
portName

The name of the desired port.

Return Value

The port associated with portName on the local host. Returns nil if no such port exists.

Availability
See Also
Declared In
NSPortNameServer.h

portForName:host:

Looks up and returns the port registered under the specified name.

- (NSPort *)portForName:(NSString *)portName host:(NSString *)hostName

Parameters
portName

The name of the desired port.

hostName

Because NSMachBootstrapServer is a local-only server; hostName must be the empty string or nil.

Return Value

The port associated with portName on the local host. Returns nil if no such port exists.

Availability
Declared In
NSPortNameServer.h

registerPort:name:

Registers a port with a specified name.

- (BOOL)registerPort:(NSPort *)port name:(NSString *)portName

Parameters
port

The port object to register with the bootstrap server.

portName

The name to associate with port.

Return Value

YES if the registration succeeded, NO otherwise.

Special Considerations

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

Availability
Declared In
NSPortNameServer.h

servicePortWithName:

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

- (NSPort *)servicePortWithName:(NSString *)name

Parameters
name

The name of the vended service.

Return Value

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

Availability
Declared In
NSPortNameServer.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-22)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.