O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSPort — Mac OS X 10.0

Synopsis

This class is an abstract class that declares the interface to objects that serve as endpoints for communication between two threads or tasks. Cocoa’s distributed objects system implements interprocess communication using subclasses of NSPort. The Foundation framework implements three concrete subclasses of NSPort: NSMessagePort, NSMachPort, and NSSocketPort. NSMessagePort and NSMachPort are used for local communications only, while NSSocketPort can be used for either local or remote communication over a network.

image with no caption

@interface NSPort : NSObject <NSCoding, NSCopying>
                                  // Convenience Constructors
   + (NSPort *)port;
                                  // Accessor Methods
   - (void)setDelegate:(id)anId;
   - (id)delegate;
                                  // Class Methods
   + (id)allocWithZone:(NSZone *)zone;
                                  // Instance Methods
   - (void)addConnection:(NSConnection *)conn 
                                 toRunLoop:(NSRunLoop *)runLoop 
                                 forMode:(NSString *)mode;
   - (BOOL)isValid;
   - (void)invalidate;
   - (void)removeConnection:(NSConnection *)conn 
                                 fromRunLoop:(NSRunLoop *)runLoop 
                                 forMode:(NSString *)mode;
   - (void)removeFromRunLoop:(NSRunLoop *)runLoop 
                                 forMode:(NSString *)mode;
   - (unsigned)reservedSpaceLength;
   - (void)scheduleInRunLoop:(NSRunLoop *)runLoop 
                                 forMode:(NSString *)mode;
   - (BOOL)sendBeforeDate:(NSDate *)limitDate 
                                 components:(NSMutableArray *)components 
                                 from:(NSPort *)receivePort
                                 reserved:(unsigned)headerSpaceReserved;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required