Type Method

serviceConnectionWithName:rootObject:usingNameServer:

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

Declaration

+ (instancetype)serviceConnectionWithName:(NSString *)name rootObject:(id)root usingNameServer:(NSPortNameServer *)server;

Parameters

name

The name of the service you want to publish.

root

The object to use as the root object for the published service. This is the object vended by the connection.

server

The port name server with which to register your service.

Return Value

An NSConnection object representing the vended service or nil if there was a problem setting up the connection object.

Discussion

This method creates the server-side of a connection object and registers it with the specified port name server. Clients wishing to connect to this service can request a communications port from the same port server and use that port to communicate.

If the specified service name corresponds to a service that is autolaunched by launchd, this method allows the service to check in with the launchd process. If the service is not autolaunched by launchd, this method registers the new connection with the specified name. For more information about launchd and its role in launching services, see Daemons and Services Programming Guide

See Also

Vending a Service

+ serviceConnectionWithName:rootObject:

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

Deprecated
- registerName:

Registers the specified service using with 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