Mac Developer Library

Developer

Foundation Framework Reference NSMessagePortNameServer Class Reference

Options
Deployment Target:

On This Page

NSMessagePortNameServer

This port name server takes and returns instances of NSMessagePort. Port removal functionality is not supported in NSMessagePortNameServer; if you want to cancel a service, you have to destroy the port (invalidate the NSMessagePort object given to registerPort:name:).

Inheritance


Conforms To


Import Statement


Not Applicable

Objective-C

@import Foundation;

Availability


Available in OS X v10.0 and later.
  • Returns the singleton instance of NSMessagePortNameServer.

    Declaration

    Objective-C

    + (id)sharedInstance

    Return Value

    The singleton instance of NSMessagePortNameServer with which you register and look up NSMessagePort objects.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.

  • Returns the NSPort object registered under a given name on the local host.

    Declaration

    Objective-C

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

    Parameters

    portName

    The port name.

    Return Value

    The NSPort registered under portName on the local host Returns nil if a port named portName does not exist.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.

  • Returns the NSPort object registered under a given name on the local host.

    Declaration

    Objective-C

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

    Parameters

    portName

    The port name.

    hostName

    The host name. Because NSMessagePortNameServer is a local-only server, hostName must be the empty string or nil.

    Return Value

    The NSPort object registered under a given name on the local host. Returns nil if a port named portName does not exist.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.0 and later.