connectionWithRegisteredName:host:
Returns the NSConnection object whose send port links it to the NSConnection object registered with the default NSPortNameServer under a given name on a given host.
Declaration
+ (instancetype) connectionWithRegisteredName:(NSString *) name host:(NSString *) hostName;Parameters
- name:
The name of an
NSConnectionobject. - hostName:
The name of the host. The domain name
hostNameis an Internet domain name (for example, “sales.anycorp.com”). IfhostNameisnilor empty, then only the local host is searched for the namedNSConnectionobject.
Return Value
The NSConnection object whose send port links it to the NSConnection object registered with the default NSPortNameServer under name on the host named hostName. Returns nil if no NSConnection object can be found for name and hostName. The returned NSConnection object is a child of the default NSConnection object for the current thread (that is, it shares the default NSConnection object’s receive port).
Discussion
To get the object vended by the NSConnection object, use the rootProxy instance method. The rootProxyForConnectionWithRegisteredName:host: class method immediately returns this object.