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 |
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.
+ (id)sharedInstance
The shared instance of NSMachBootstrapServer
with which you register and look up NSMachPort
objects.
NSPortNameServer.h
Looks up and returns the port registered under the specified name on the local host.
- (NSPort *)portForName:(NSString *)portName
The name of the desired port.
The port associated with portName on the local host. Returns nil
if no such port exists.
NSPortNameServer.h
Looks up and returns the port registered under the specified name.
- (NSPort *)portForName:(NSString *)portName host:(NSString *)hostName
The name of the desired port.
Because NSMachBootstrapServer
is a local-only server; hostName must be the empty string or nil
.
The port associated with portName on the local host. Returns nil
if no such port exists.
NSPortNameServer.h
Registers a port with a specified name.
- (BOOL)registerPort:(NSPort *)port name:(NSString *)portName
The port object to register with the bootstrap server.
The name to associate with port.
YES
if the registration succeeded, NO
otherwise.
Once registered, a port cannot be unregistered; instead, you need to invalidate the port.
NSPortNameServer.h
Looks up and returns the port for the vended service that is registered under the specified name.
- (NSPort *)servicePortWithName:(NSString *)name
The name of the vended service.
The port associated with name. Returns nil
if no such port exists.
NSPortNameServer.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-22)