Next Page > Hide TOC

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

Tasks

Getting the Server Object

Getting Ports By Name

Class Methods

sharedInstance

Returns the singleton instance of NSMessagePortNameServer.

+ (id)sharedInstance

Return Value

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

Availability
Declared In
NSPortNameServer.h

Instance Methods

portForName:

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

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

Availability
See Also
Declared In
NSPortNameServer.h

portForName:host:

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

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

Availability
Declared In
NSPortNameServer.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-23)


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.