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

NSPortMessage — Mac OS X 10.0

Synopsis

Instances of this class represent low-level interapplication communication meesages. Cocoa’s distributed objects system uses this class extensively for communications between applications on the same host machine. Associated with each port messages is a sending NSPort, a receiving NSPort, and an array of message components that may be instances of NSData or NSPort. Instances of this class are initialized using the method initWithSendPort:receivePort:components:. Messages are sent by invoking the method sendBeforeDate:. Finally, the components method is used to retrieve the components of a port message, while sendPort and receivePort are used to retrieve the port message’s send and receive port objects. Applications should make use of the high-level Distributed Objects API for interapplication communication, and resort to raw messaging with port messages for exceptional circumstances.

image with no caption

@interface NSPortMessage : NSObject
                                  // Initializers
   - (id)initWithSendPort:(NSPort *)sendPort 
                                 receivePort:(NSPort *)replyPort 
                                 components:(NSArray *)components;
                                  // Accessor Methods
   - (void)setMsgid:(unsigned)msgid;
   - (unsigned)msgid;
                                  // Instance Methods
   - (NSArray *)components;
   - (NSPort *)receivePort;
   - (BOOL)sendBeforeDate:(NSDate *)date;
   - (NSPort *)sendPort;

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