Instance Method

registerName:

Registers the specified service using with the default system port name server.

Declaration

- (BOOL)registerName:(NSString *)name;

Parameters

name

The name under which to register the receiver.

Return Value

YES if the operation was successful, otherwise NO (for example, if another NSConnection object on the same host is already registered under name).

Discussion

This method connects the receive port of the receiving NSConnection object with the specified service name. It registers the name using the port name server returned by the systemDefaultPortNameServer method of NSPortNameServer. If the operation is successful, other NSConnection objects can contact the receiver using the connectionWithRegisteredName:host: and rootProxyForConnectionWithRegisteredName:host: class methods.

If the receiver was already registered under a name and this method returns NO, the old name remains in effect. If this method is successful, it also unregisters the old name.

To unregister an NSConnection object, simply invoke registerName: and supply nil as the connection name. Unregistering is currently only supported for NSSocketPort-based connections.

See Also

Vending a Service

+ serviceConnectionWithName:rootObject:usingNameServer:

Creates and returns a new connection object representing a vended service on the specified port name server.

Deprecated
+ serviceConnectionWithName:rootObject:

Creates and returns a new connection object representing a vended service on the default system port name server.

Deprecated
- registerName:withNameServer:

Registers a service with the specified port name server.

Deprecated
rootObject

The object that the receiver (or its parent) makes available to other applications or threads.

Deprecated