Mac Developer Library

Developer

Foundation Framework Reference NSMachBootstrapServer Class Reference

Options
Deployment Target:

On This Page
Language:

NSMachBootstrapServer

Inheritance


Conforms To


Import Statement


Not Applicable

Objective-C

@import Foundation;

Availability


Available in OS X v10.0 and later.

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:).

  • Returns the shared instance of the bootstrap server.

    Declaration

    Objective-C

    + (id)sharedInstance

    Return Value

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

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.5 and later.

  • Registers a port with a specified name.

    Declaration

    Objective-C

    - (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

    YEStrue if the registration succeeded, NOfalse otherwise.

    Special Considerations

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

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.