ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/FoundationKit/Classes/NSConnection.rtf

This is NSConnection.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSConnection 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSObject (NSObject)
fs20 
fs28 s7 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSConnection.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 The NSConnection class declares the programmatic interface to objects that manage a i connectioni0  such that objects in one thread can send messages to objects in another thread (typically, in another process, and it defines instances that manage each side of such a connection. 
fs16 
fs28 Each distinct thread of execution has one default connection defined. Any given thread can have as many connections as desired, but a given connection can be served by only one thread.
fs16 
fs28 To set up a connection, some object in your application must be established as what is known as a 'aaroot'ba object and registered with a name in the Network Name Server. Such root objects can then be connected to by other threads, and can receive messages sent to them from other threads. An easy way to establish an object as a root object is to send the b defaultConnectionb0  method to the NSConnection class object to obtain a connection object. Then use b setRootObject: b0 tob  b0 establish the desired object as the object that will be registered, followed by b registerName:b0  to make that object available to the Network Name Server under the specified name.
fs16 
fs28 To obtain a connection to an object registered elsewhere, you will generally send theb  rootProxyForConnectionWithRegisteredName:host:b0  method to the NSConnection class object. This method returns a proxy to the remote object. You should then inform the proxy of the protocol(s) the remote object responds to using b setProtocolForProxy:b0 . To obtain the actual connection object instead of the proxy, use the b connectionWithRegisteredName:host:b0  method.
fs16 
fs28 If the string b @"*"b0  is used where a hostname is required, it implies a lookup for any server registered with the specified name on the local subnet. If b nilb0  is supplied where a hostname is required, the name lookup occurs only on the local host.
fs16 
fs28 When an NSConnection object is deallocated, the notification NSConnectionDeath is posted to the default notification center with that NSConnection object.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Exceptions
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 NSConnection can raise NSInternalInconsistencyException for a variety of reasons when it detects 'aaimpossible'ba situations. In addition, NSConnection can raise NSInvalidArgumentException when a remote method invocation sends an unknown selector.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Initializing a Connection
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b initb0 tab Initialize a newly allocated NSConnection suitable for a new registry and new name.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Establishing a Connection
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (NSConnection *)b connectionWithRegisteredName:b0 (NSString *)i namei0  
s9 li7030 fi-6553 fi-5796 b host:b0 (NSString *)i hostNamei0 tab Registers and returns a connection with i namei0  on i hostNamei0 .
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSConnection *)b defaultConnectionb0 tab Establishes and returns a default per-thread connection.
fi-6552 fs16 
fs28 fi-6552 + (NSDistantObject *)b rootProxyForConnectionWithRegisteredName:b0 (NSString *)i namei0  
s9 li7030 fi-6553 fi-5796 b hostb0 :(NSString *)i hostNamei0 tab Registers a connection with i namei0  on i hostNamei0  and returns its root proxy.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Determining Connections
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (NSArray *)b allConnectionsb0 tab Returns an array describing all existing valid connections.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isValidb0 tab Identifies that the receiver is a valid connection.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Registering a Connection
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b registerName:b0 (NSString *)i namei0 tab Registers the connection with i namei0  on the local system and returns YES if the registration was successful, NO otherwise.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Assigning a Delegate
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b delegatetab b0 Returns the connection'27s delegate.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setDelegate:b0 (id)i anObjecti0 tab Sets the connection'27s delegate.tab 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting and Setting the Root Object
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b rootObjectb0 tab Returns the root object served.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSDistantObject *)b rootProxyb0 tab Returns an NSDistantObject proxy to the root object served by this connection.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setRootObject:b0 (id)i anObjecti0 tab Sets the root object being served to i anObjecti0 ; if the root object already exists, replaces it with i anObjecti0 .  Be aware that if the root object is replaced while a connection is active, existing root proxies on the client side of the connection will continue to communicate with the previous root object, while new proxies will communicate with the newly established root object. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Request Mode
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b requestModeb0 tab Returns the mode in which requests are honored.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setRequestMode:b0 (NSString *)i modei0 tab Sets the mode in which requests are honored to i modei0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Conversation Queueing
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -}(BOOL)b independentConversationQueueingb0 tab Returns b conversationQueuingb0  mode. The default value is NO.
fi-6552 fs16 
fs28 fi-6552 {f3 -}(void)b setIndependentConversationQueueing:b0 (BOOL)i flag
s9 li7030 fi-6553 fi-5796 i0 tab If i flagi0  is YES, unrelated requests are queued for later processing. This allows a server to use distributed objects freely in its implementation without concern for the consistency of its internal state. Note that this can cause deadlocks among peers.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Timeouts
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSTimeInterval)b replyTimeoutb0 tab Returns the reply timeout time interval.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSTimeInterval)b requestTimeoutb0 tab Returns the request timeout time interval.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setReplyTimeout:b0 (NSTimeInterval)i intervaltab i0 Sets the reply timeout to the time interval i intervali0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setRequestTimeout:b0 (NSTimeInterval)i intervali0 tab  Sets the request timeout to the time interval i intervali0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Get Statistics
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSDictionary *)b statisticsb0 tab Returns statistics for this connection.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Implemented by the Delegate
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b makeNewConnection:b0 (NSConnection *)i connection
s9 li7030 fi-6553 fi-5796 i0 b sender:b0 (NSConnection *)i ancestori0 tab Asks permission to create a new connection i connectioni0  where i ancestori0  is the ancestral connection; returns YES if connection allowed.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.