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

NSConnection — Mac OS X 10.0

Synopsis

This class declares the interface to objects that manage communications between objects that reside in separate processes. The NSConnection class forms the groundwork for Cocoa’s distributed objects system, which is described in more detail in Chapter 6. NSConnection supports inter-process communication on the local host, as well as between two hosts over a network. NSConnection is frequently used to facilitate communication between threads in a multithreaded application. Clients use the NSConnection class primarily for vending objects (making them available to other processes), accessing vended objects, and for fine-tuning communication parameters.

image with no caption

@interface NSConnection : NSObject
                                  // Convenience Constructors
   + (NSConnection *)connectionWithReceivePort:(NSPort *)receivePort 
                                 sendPort:(NSPort *)sendPort;
   + (NSConnection *)connectionWithRegisteredName:(NSString *)name 
                                 host:(NSString *)hostName;
   + (NSConnection *)connectionWithRegisteredName:(NSString *)name 
                                 host:(NSString *)hostName
                                 usingNameServer:(NSPortNameServer *)server;
                                  // Initializers
   - (id)initWithReceivePort:(NSPort *)receivePort 
                                 sendPort:(NSPort *)sendPort;
                                  // Accessor Methods
   - (void)setRequestTimeout:(NSTimeInterval)ti;
   - (NSTimeInterval)requestTimeout;
   - (void)setReplyTimeout:(NSTimeInterval)ti;
   - (NSTimeInterval)replyTimeout;
   - (void)setRootObject ...

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