2000-03-05 17:39:33 +00:00
|
|
|
<html><head>
|
2000-09-22 13:45:58 +00:00
|
|
|
<title>NSConnection</title>
|
2000-03-05 17:39:33 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="NSConditionLock.html">[Previous]</a>
|
|
|
|
<a href ="Base.html">[Up]</a>
|
|
|
|
<a href ="NSCountedSet.html">[Next]</a>
|
2000-03-05 17:39:33 +00:00
|
|
|
<h1>NSConnection</h1>
|
2000-09-22 13:45:58 +00:00
|
|
|
<h3>Authors </h3>
|
|
|
|
<dl>
|
|
|
|
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
|
2000-03-05 17:39:33 +00:00
|
|
|
<dd>
|
|
|
|
</dl>
|
2000-07-04 19:53:39 +00:00
|
|
|
<p>Version: 0.2</p>
|
|
|
|
<p>Date: 4 July, 2000</p>
|
2000-09-22 13:45:58 +00:00
|
|
|
<h2><a name ="cont-0">NSConnection</a></h2>
|
|
|
|
<h2><a name ="NSConnection">NSConnection</a></h2>
|
|
|
|
<p><b>Declared in: </b> Foundation/NSConnection.h</p>
|
|
|
|
<p><b>Inherits from: </b> NSObject</p>
|
|
|
|
<p><b>Conforms to: </b> NSObject
|
2000-03-05 17:39:33 +00:00
|
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
NSConnection objects are used to manage communications between
|
|
|
|
objects in different processes, in different machines, or in
|
|
|
|
different threads.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<h2>Instance Variables </h2>
|
2000-09-15 19:56:39 +00:00
|
|
|
<ul>
|
|
|
|
</ul>
|
2000-09-22 13:45:58 +00:00
|
|
|
<h2>Methods </h2>
|
2000-03-05 17:39:33 +00:00
|
|
|
<ul>
|
2000-09-22 13:45:58 +00:00
|
|
|
<li><a href ="NSConnection.html#method-0">+allConnections</a>
|
|
|
|
<li><a href ="NSConnection.html#method-1">+connectionWithReceivePort:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-2">+connectionWithRegisteredName:host:</a>
|
|
|
|
<li><a href ="NSConnection.html#connectionWithRegisteredName:host:usingNameServer:">+connectionWithRegisteredName:host:usingNameServer:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-3">+currentConversation</a>
|
|
|
|
<li><a href ="NSConnection.html#method-4">+defaultConnection</a>
|
|
|
|
<li><a href ="NSConnection.html#method-5">+newRegisteringAtName:withRootObject:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-7">+rootProxyForConnectionWithRegisteredName:host:</a>
|
|
|
|
<li><a href ="NSConnection.html#rootProxyForConnectionWithRegisteredName:host:usingNameServer:">+rootProxyForConnectionWithRegisteredName:host:usingNameServer:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-8">-addRequestMode:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-9">-addRunLoop:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-36">-authenticateComponents:withData:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-37">-authenticationDataForComponents:</a>
|
|
|
|
<li><a href ="NSConnection.html#connection:shouldMakeNewConnection">-connection:shouldMakeNewConnection:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-10">-delegate</a>
|
|
|
|
<li><a href ="NSConnection.html#method-11">-enableMultipleThreads</a>
|
|
|
|
<li><a href ="NSConnection.html#method-12">-independentConversationQueueing</a>
|
|
|
|
<li><a href ="NSConnection.html#initWithReceivePort:sendPort:">-initWithReceivePort:sendPort:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-13">-invalidate</a>
|
|
|
|
<li><a href ="NSConnection.html#method-14">-isValid</a>
|
|
|
|
<li><a href ="NSConnection.html#method-15">-localObjects</a>
|
|
|
|
<li><a href ="NSConnection.html#method-38">-makeNewConnection:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-16">-multipleThreadsEnabled</a>
|
|
|
|
<li><a href ="NSConnection.html#method-17">-receivePort</a>
|
|
|
|
<li><a href ="NSConnection.html#method-18">-registerName:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-19">-registerName:withNameServer:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-20">-remoteObjects</a>
|
|
|
|
<li><a href ="NSConnection.html#method-21">-removeRequestMode:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-22">-removeRunLoop:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-23">-replyTimeout</a>
|
|
|
|
<li><a href ="NSConnection.html#method-24">-requestModes</a>
|
|
|
|
<li><a href ="NSConnection.html#method-25">-requestTimeout</a>
|
|
|
|
<li><a href ="NSConnection.html#method-26">-rootObject</a>
|
|
|
|
<li><a href ="NSConnection.html#method-27">-rootProxy</a>
|
|
|
|
<li><a href ="NSConnection.html#method-28">-runInNewThread</a>
|
|
|
|
<li><a href ="NSConnection.html#method-29">-sendPort</a>
|
|
|
|
<li><a href ="NSConnection.html#method-30">-setDelegate:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-31">-setIndependentConversationQueueing:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-32">-setReplyTimeout:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-33">-setRequestTimeout:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-34">-setRootObject:</a>
|
|
|
|
<li><a href ="NSConnection.html#method-35">-statistics</a>
|
2000-03-05 17:39:33 +00:00
|
|
|
</ul>
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr><h2>Class Methods </h2>
|
|
|
|
<h3><a name ="method-0">allConnections</a></h3>
|
|
|
|
+ (NSArray*) <b>allConnections</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns an array containing all the NSConnection objects known to
|
|
|
|
the system. These connections will be valid at the time that the
|
|
|
|
array was created, but may be invalidated by other threads
|
|
|
|
before you get to examine the array.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-1">connectionWithReceivePort:</a></h3>
|
|
|
|
+ (NSConnection*) <b>connectionWithReceivePort:</b> (NSPort*)receivePort;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns a connection created using
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="#initWithReceivePort:sendPort:">
|
2000-07-04 19:53:39 +00:00
|
|
|
initWithReceivePort:sendPort:</a>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-2">connectionWithRegisteredName:host:</a></h3>
|
|
|
|
+ (NSConnection*) <b>connectionWithRegisteredName:</b> (NSString*)name <b>host:</b> (NSString*)hostName;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
<p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns an NSConnection object whose send port is that of the
|
|
|
|
NSConnection registered under <em>name</em> on the host
|
|
|
|
<em>hostName</em>.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
<p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
This method calls
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="#connectionWithRegisteredName:host:usingNameServer:">
|
2000-07-04 19:53:39 +00:00
|
|
|
connectionWithRegisteredName:host:usingNameServer:</a> using
|
|
|
|
the default system name server.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="connectionWithRegisteredName:host:usingNameServer:">connectionWithRegisteredName:host:usingNameServer:</a></h3>
|
|
|
|
+ (NSConnection*) <b>connectionWithRegisteredName:</b> (NSString*)name <b>host:</b> (NSString*)host <b>usingNameServer:</b> (NSPortNameServer*)server;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
Returns an NSConnection object whose send port is that of the
|
|
|
|
NSConnection registered under <em>name</em> on <em>host</em>.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
The nameserver <em>server</em> is used to look up the send
|
|
|
|
port to be used for the connection.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If <em>host</em> is <code>nil</code> or an empty string,
|
|
|
|
the host is taken to be the local machine.
|
|
|
|
If it is an asterisk ('*') then the nameserver checks all
|
|
|
|
hosts on the local subnet (unless the nameserver is one
|
|
|
|
that only manages local ports).
|
|
|
|
In the GNUstep implementation, the local host is searched before
|
|
|
|
any other hosts.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If no NSConnection can be found for <em>name</em> and
|
|
|
|
<em>host</em>host, the method returns <code>nil</code>.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
The returned object has the default NSConnection of the
|
|
|
|
current thread as its parent (it has the same receive port
|
|
|
|
as the default connection).
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-3">currentConversation</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
+ (id) <b>currentConversation</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Not implemented
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-4">defaultConnection</a></h3>
|
|
|
|
+ (NSConnection*) <b>defaultConnection</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the default NSConnection for the current thread.
|
|
|
|
<br>
|
|
|
|
Creates a new instance if necessary.
|
|
|
|
<br>
|
|
|
|
The default connection has a single NSPort object used for
|
|
|
|
both sending and receiving - this it can't be used to
|
|
|
|
connect to a remote process, but can be used to vend objects.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-5">newRegisteringAtName:withRootObject:</a></h3>
|
|
|
|
+ (NSConnection*) <b>newRegisteringAtName:</b> (NSString*)name <b>withRootObject:</b> (id)anObject;<br>
|
|
|
|
Standards: GNUstep NotMacOS-X NotOpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
This used to be the preferred mechanism for creating a GNUstep
|
|
|
|
server NSConnection ... it is now deprecated.
|
|
|
|
<br>
|
|
|
|
This is a convenience method for -
|
2000-09-22 13:45:58 +00:00
|
|
|
<a name ="label-6">example </a>
|
2000-07-04 19:53:39 +00:00
|
|
|
<pre>
|
|
|
|
|
|
|
|
NSConnection *conn;
|
|
|
|
|
|
|
|
conn = [[NSConnection alloc] initWithReceivePort: [NSPort port]
|
|
|
|
sendPort: nil];
|
|
|
|
[conn setRootObject: anObject];
|
|
|
|
if ([conn registerName: name] == NO)
|
|
|
|
{
|
|
|
|
DESTROY(conn);
|
|
|
|
}
|
|
|
|
return conn;
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
</pre>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-7">rootProxyForConnectionWithRegisteredName:host:</a></h3>
|
|
|
|
+ (NSDistantObject*) <b>rootProxyForConnectionWithRegisteredName:</b> (NSString*)name <b>host:</b> (NSString*)host;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
This method calls <a href ="#rootProxyForConnectionWithRegisteredName:host:usingNameServer:">
|
2000-07-04 19:53:39 +00:00
|
|
|
rootProxyForConnectionWithRegisteredName:host:usingNameServer:</a>
|
|
|
|
to return a proxy for a root object on the remote connection with
|
|
|
|
the send port registered under <em>name</em> on <em>host</em>
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="rootProxyForConnectionWithRegisteredName:host:usingNameServer:">rootProxyForConnectionWithRegisteredName:host:usingNameServer:</a></h3>
|
|
|
|
+ (NSDistantObject*) <b>rootProxyForConnectionWithRegisteredName:</b> (NSString*)name <b>host:</b> (NSString*)host <b>usingNameServer:</b> (NSPortNameServer*)server;<br>
|
|
|
|
Standards: GNUstep MacOS-X NotOpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
This method calls
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="NSConnection.html#connectionWithRegisteredName:host:usingNameServer:">
|
2000-07-04 19:53:39 +00:00
|
|
|
connectionWithRegisteredName:host:usingNameServer:</a>
|
|
|
|
to get a connection, then sends it a
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="#rootproxy">rootProxy</a> message to get a proxy for
|
2000-07-04 19:53:39 +00:00
|
|
|
the root object being vended by the remote connection.
|
|
|
|
Returns the proxy or <code>nil</code> if it couldn't find
|
|
|
|
a connection or if the root object for the connection has
|
|
|
|
not been set.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<hr><h2>Instances Methods </h2>
|
|
|
|
<h3><a name ="method-8">addRequestMode:</a></h3>
|
|
|
|
- (void) <b>addRequestMode:</b> (NSString*)mode;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
Adds <em>mode</em> to the run loop modes that the NSConnection
|
|
|
|
will listen to for incoming messages.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-9">addRunLoop:</a></h3>
|
|
|
|
- (void) <b>addRunLoop:</b> (NSRunLoop*)loop;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
Adds <em>loop</em> to the set of run loops that the NSConnection
|
|
|
|
will listen to for incoming messages.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-10">delegate</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (id) <b>delegate</b>;<br>
|
|
|
|
|
|
|
|
Returns the delegate of the NSConnection.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-11">enableMultipleThreads</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>enableMultipleThreads</b>;<br>
|
|
|
|
|
|
|
|
Sets the NSConnection configuration so that multiple threads may
|
|
|
|
use the connection to send requests to the remote connection.
|
|
|
|
<br>
|
|
|
|
This option is inherited by child connections.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-12">independentConversationQueueing</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (BOOL) <b>independentConversationQueueing</b>;<br>
|
|
|
|
|
|
|
|
Returns <code>YES</code> if the NSConnection is configured to
|
|
|
|
handle remote messages atomically, <code>NO</code> otherwise.
|
|
|
|
<br>
|
|
|
|
This option is inherited by child connections.
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="initWithReceivePort:sendPort:">initWithReceivePort:sendPort:</a></h3>
|
|
|
|
<b>This is the designated initialiser </b><br>
|
|
|
|
- (id) <b>initWithReceivePort:</b> (NSPort*)recv <b>sendPort:</b> (NSPort*)send;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
Initialises an NSConnection with <em>recv</em> and <em>send</em>.
|
|
|
|
<br>
|
|
|
|
Behavior varies with the port values as follows -
|
|
|
|
<dl>
|
|
|
|
<dt><em>recv</em> is <code>nil</code>
|
|
|
|
<dd>
|
|
|
|
The NSConnection is released and the method returns
|
|
|
|
<code>nil</code>.
|
|
|
|
|
|
|
|
<dt><em>send</em> is <code>nil</code>
|
|
|
|
<dd>
|
|
|
|
The NSConnection uses <em>recv</em> as the send port as
|
|
|
|
well as the receive port.
|
|
|
|
|
|
|
|
<dt><em>send</em> is the same as <em>recv</em>
|
|
|
|
<dd>
|
|
|
|
The NSConnection is usable only for vending objects.
|
|
|
|
|
|
|
|
<dt>A connection with the same ports exists
|
|
|
|
<dd>
|
|
|
|
The new connection is released and the old connection
|
|
|
|
is retained and returned.
|
|
|
|
|
|
|
|
<dt>A connection with the same ports (swapped) exists
|
|
|
|
<dd>
|
|
|
|
The new connection is initialised as normal, and will
|
|
|
|
communicate with the old connection.
|
|
|
|
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If a connection exists whose send and receive ports are
|
|
|
|
both the same as the new connections receive port, that
|
|
|
|
existing connection is deemed to be the parent of the
|
|
|
|
new connection. The new connection inherits configuration
|
|
|
|
information from the parent, and the delegate of the
|
|
|
|
parent has a chance to adjust ythe configuration of the
|
|
|
|
new connection or veto its creation.
|
|
|
|
<br>
|
|
|
|
NSConnectionDidInitializeNotification is posted once a new
|
|
|
|
connection is initialised.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-13">invalidate</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>invalidate</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Marks the receiving NSConnection as invalid.
|
|
|
|
<br>
|
|
|
|
Removes the NSConnections ports from any run loops.
|
|
|
|
<br>
|
|
|
|
Posts an NSConnectionDidDieNotification.
|
|
|
|
<br>
|
|
|
|
Invalidates all remote objects and local proxies.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-14">isValid</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (BOOL) <b>isValid</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns <code>YES</code> if the connection is invalid,
|
|
|
|
<code>NO</code> otherwise.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-15">localObjects</a></h3>
|
|
|
|
- (NSArray*) <b>localObjects</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns an array of all the local proxies to objects that
|
|
|
|
are retained by the remote connection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-16">multipleThreadsEnabled</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (BOOL) <b>multipleThreadsEnabled</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns <code>YES</code> if the connection permits
|
|
|
|
multiple threads to use it to send requests,
|
|
|
|
<code>NO</code> otherwise.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-17">receivePort</a></h3>
|
|
|
|
- (NSPort*) <b>receivePort</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the NSPort object on which incoming messages are
|
|
|
|
recieved.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-18">registerName:</a></h3>
|
|
|
|
- (BOOL) <b>registerName:</b> (NSString*)name;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
Simply invokes <a href ="#registerName:usingNameServer:">
|
2000-07-04 19:53:39 +00:00
|
|
|
registerName:usingNameServer:</a> passing it the default
|
|
|
|
system nameserver.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-19">registerName:withNameServer:</a></h3>
|
|
|
|
- (BOOL) <b>registerName:</b> (NSString*)name <b>withNameServer:</b> (NSPortNameServer*)server;<br>
|
|
|
|
Standards: GNUstep MacOS-X NotOpenStep<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Registers the recieve port of the NSConnection as <em>name</em> and
|
|
|
|
unregisters the previous name (if any).
|
|
|
|
<br>
|
|
|
|
Returns <code>YES</code> on success, <code>NO</code> on failure.
|
|
|
|
<br>
|
|
|
|
On failure, the connection remains registered under the
|
|
|
|
previous name.
|
|
|
|
<br>
|
|
|
|
Supply <code>nil</code> as <em>name</em> to unregister the
|
|
|
|
NSConnection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-20">remoteObjects</a></h3>
|
|
|
|
- (NSArray*) <b>remoteObjects</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns an array of proxies to all the remote objects known to
|
|
|
|
the NSConnection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-21">removeRequestMode:</a></h3>
|
|
|
|
- (void) <b>removeRequestMode:</b> (NSString*)mode;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Removes <em>mode</em> from the run loop modes used to recieve
|
|
|
|
incoming messages.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-22">removeRunLoop:</a></h3>
|
|
|
|
- (void) <b>removeRunLoop:</b> (NSRunLoop*)loop;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Removes <em>loop</em> from the run loops used to recieve
|
|
|
|
incoming messages.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-23">replyTimeout</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (NSTimeInterval) <b>replyTimeout</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the timeout interval used when waiting for a reply to
|
|
|
|
a request sent on the NSConnection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-24">requestModes</a></h3>
|
|
|
|
- (NSArray*) <b>requestModes</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns an array of all the run loop modes that the NSConnection
|
|
|
|
uses when waiting for an incoming request.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-25">requestTimeout</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (NSTimeInterval) <b>requestTimeout</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the timeout interval used when waiting for a send
|
|
|
|
operation to complete.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-26">rootObject</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (id) <b>rootObject</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the object that is made available by this connection
|
|
|
|
or by its parent (the object is associated with the receive
|
|
|
|
port).
|
|
|
|
<br>
|
|
|
|
Returns <code>nil</code> if no root object has been set.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-27">rootProxy</a></h3>
|
|
|
|
- (NSDistantObject*) <b>rootProxy</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the proxy for the root object of the remote NSConnection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-28">runInNewThread</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>runInNewThread</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Removes the NSConnection from the current threads default
|
|
|
|
run loop, then creates a new thread and runs the NSConnection
|
|
|
|
in it.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-29">sendPort</a></h3>
|
|
|
|
- (NSPort*) <b>sendPort</b>;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Returns the port on which the NSConnection sends messages.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-30">setDelegate:</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>setDelegate:</b> (id)delegate;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Sets the NSConnection's delegate (without retaining it).
|
|
|
|
<br>
|
|
|
|
The delegate is able to control some of the NSConnection's
|
|
|
|
behavior by implementing methods in an informal protocol.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-31">setIndependentConversationQueueing:</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>setIndependentConversationQueueing:</b> (BOOL)flag;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Sets whether or not the NSConnection should handle requests
|
|
|
|
arriving from the remote NSConnection atomically.
|
|
|
|
<br>
|
|
|
|
By default, this is set to <code>NO</code> ... if set to
|
|
|
|
<code>YES</code> then any messages arriving while one message
|
|
|
|
is being dealt with, will be queued.
|
|
|
|
<br>
|
|
|
|
NB. careful - use of this option can cause deadlocks.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-32">setReplyTimeout:</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>setReplyTimeout:</b> (NSTimeInterval)seconds;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Sets the time interval that the NSConnection will wait for a
|
|
|
|
reply to one of its requests before raising an
|
|
|
|
NSPortTimeoutException.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-33">setRequestTimeout:</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>setRequestTimeout:</b> (NSTimeInterval)seconds;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Sets the time interval that the NSConnection will to send
|
|
|
|
one of its requests before raising an NSPortTimeoutException.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-34">setRootObject:</a></h3>
|
2000-07-04 19:53:39 +00:00
|
|
|
- (void) <b>setRootObject:</b> (id)anObject;<br>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-07-04 19:53:39 +00:00
|
|
|
Sets the root object that is vended by the connection.
|
2000-03-05 17:39:33 +00:00
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-35">statistics</a></h3>
|
|
|
|
- (NSDictionary*) <b>statistics</b>;<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
Returns an object containing various statistics for the
|
|
|
|
NSConnection.
|
|
|
|
<br>
|
|
|
|
On GNUstep the dictionary contains -
|
|
|
|
<dl>
|
|
|
|
<dt>NSConnectionRepliesReceived
|
|
|
|
<dd>
|
|
|
|
The number of messages replied to by the remote NSConnection
|
|
|
|
|
|
|
|
<dt>NSConnectionRepliesSent
|
|
|
|
<dd>
|
|
|
|
The number of replies sent to the remote NSConnection
|
|
|
|
|
|
|
|
<dt>NSConnectionRequestsReceived
|
|
|
|
<dd>
|
|
|
|
The number of messages recieved from the remote NSConnection
|
|
|
|
|
|
|
|
<dt>NSConnectionRequestsSent
|
|
|
|
<dd>
|
|
|
|
The number of messages sent to the remote NSConnection
|
|
|
|
|
|
|
|
<dt>NSConnectionLocalCount
|
|
|
|
<dd>
|
|
|
|
The number of local objects currently vended
|
|
|
|
|
|
|
|
<dt>NSConnectionProxyCount
|
|
|
|
<dd>
|
|
|
|
The number of remote objects currently in use
|
|
|
|
|
|
|
|
</dl>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-36">authenticateComponents:withData:</a></h3>
|
|
|
|
- (BOOL) <b>authenticateComponents:</b> (NSMutableArray*)components <b>withData:</b> (NSData*)authentication;<br>
|
|
|
|
Standards: GNUstep MacOS-X NotOpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
This is not an NSConnection method, but is a method that may
|
|
|
|
be implemented by the delegate of an NSConnection object.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If the delegate implements this method, the NSConnection will
|
|
|
|
invoke the method for every message request or reply it receives
|
|
|
|
from the remote NSConnection. The delegate should use the
|
|
|
|
<em>authentication</em> data to check all the NSData objects
|
|
|
|
in the <em>components</em> array (ignoring NSPort objects),
|
|
|
|
and return <code>YES</code> if they are valid, <code>NO</code>
|
|
|
|
otherwise.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If the method returns <code>NO</code> then an
|
|
|
|
NSFailedAuthentication exception will be raised.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
In GNUstep the <em>components</em> array is mutable, allowing
|
|
|
|
you to replace the NSData objects with your own version.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-37">authenticationDataForComponents:</a></h3>
|
|
|
|
- (NSData*) <b>authenticationDataForComponents:</b> (NSMutableArray*)components;<br>
|
|
|
|
Standards: GNUstep MacOS-X NotOpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
This is not an NSConnection method, but is a method that may
|
|
|
|
be implemented by the delegate of an NSConnection object.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If the delegate implements this method, the NSConnection will
|
|
|
|
invoke the method for every message request ro reply it sends
|
|
|
|
to the remote NSConnection. The delegate should generate
|
|
|
|
authentication data by examining all the NSData objects
|
|
|
|
in the <em>components</em> array (ignoring NSPort objects),
|
|
|
|
and return the authentication data that can be used by the
|
|
|
|
remote NSConnection.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If the method returns <code>nil</code> then an
|
|
|
|
NSGenericException exception will be raised.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
In GNUstep the <em>components</em> array is mutable, allowing
|
|
|
|
you to replace the NSData objects with your own version.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="connection:shouldMakeNewConnection">connection:shouldMakeNewConnection:</a></h3>
|
|
|
|
- (BOOL) <b>connection:</b> (NSConnection*)parentConnection <b>shouldMakeNewConnection:</b> (NSConnection*)newConnnection;<br>
|
|
|
|
Standards: GNUstep MacOS-X NotOpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
This is not an NSConnection method, but is a method that may
|
|
|
|
be implemented by the delegate of an NSConnection object.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
If the delegate implements this method, it will be called
|
|
|
|
whenever a new NSConnection is created that has this
|
|
|
|
NSConnection as its parent. The delegate may take this
|
|
|
|
opportunity to adjust the configuration of the new
|
|
|
|
connection and may return a boolean value to tell the
|
|
|
|
parent whether the creation of the new connection is to
|
|
|
|
be permitted or not.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
|
|
|
<h3><a name ="method-38">makeNewConnection:</a></h3>
|
|
|
|
- (BOOL) <b>makeNewConnection:</b> (NSConnection*)newConnection;<br>
|
|
|
|
Standards: OpenStep<br>
|
2000-07-04 19:53:39 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
This is not an NSConnection method, but is a method that may
|
|
|
|
be implemented by the delegate of an NSConnection object.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
This is the old equivalent of
|
2000-09-22 13:45:58 +00:00
|
|
|
<a href ="NSConnection.html#connection:shouldMakeNewConnection">
|
2000-07-04 19:53:39 +00:00
|
|
|
connection:shouldMakeNewConnection</a>
|
|
|
|
and its use is now deprecated.
|
|
|
|
</p>
|
2000-03-05 17:39:33 +00:00
|
|
|
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
<hr>
|
2000-03-05 17:39:33 +00:00
|
|
|
</body>
|
|
|
|
|
2000-09-22 13:45:58 +00:00
|
|
|
</html>
|