Class

NSSocketPortNameServer

A port name server that takes and returns socket ports.

Overview

Port removal functionality is supported by the removePortForName: method and should be used to remove invalid socket ports.

Unlike the other port name servers, NSSocketPortNameServer can operate over a network. By registering your socket ports, you make them available to other computers on the local network without hard-coding the TCP port numbers. Clients just need to know the name of the port.

NSPortNameServer is implemented using NSNetService and registers ports in the local network domain. The registered name of a port must be unique within the local domain, not just the local host. The name server only supports TCP/IP (either IPv4 or IPv6) sockets.

Topics

Getting the Server Object

sharedInstance

Returns the shared socket port name server.

Looking up Ports

portForName:

Looks up and returns the port registered under the specified name on the local host.

portForName:host:

Looks up and returns the port registered under the specified name on a specified host.

portForName:host:nameServerPortNumber:

Looks up and returns the port registered under the specified name on a specified host.

Registering and Removing Ports

registerPort:name:

Registers a given port as a network service with the specified name in the local domain.

registerPort:name:nameServerPortNumber:

Registers a given port as a network service with the specified name in the local domain.

removePortForName:

Unregisters the port for a given name on the local host.

Configuring the Default Port Number

defaultNameServerPortNumber

Returns the port number used to contact the name server.

setDefaultNameServerPortNumber:

Sets the default port number used to contact the name server.

Instance Properties

Relationships

Inherits From

See Also

Legacy

NSMachPortDelegate

An interface for handling incoming Mach messages.

NSConnectionDelegate

An interface for interacting with low-level, interprocess connections.

Deprecated
NSConnection

An object that manages the communication between objects in different threads or between a thread and a process running on a local or remote system.

Deprecated
NSDistantObject

A proxy for objects in other applications or threads.

Deprecated
NSDistantObjectRequest

An object used by the distributed objects system to help handle invocations between different processes.

Deprecated
NSMachBootstrapServer

A port name server that takes and returns Mach port objects.

Deprecated
NSMachPort

A port that can be used as an endpoint for distributed object connections (or raw messaging).

NSMessagePort

A port that can be used as an endpoint for distributed object connections (or raw messaging).

NSMessagePortNameServer

A server takes and returns message ports.

Deprecated
NSPortCoder

A coder used to transmit object proxies (and sometimes objects themselves) between connections.

Deprecated
NSPortDelegate

An interface for handling incoming messages.

NSPortMessage

A low-level, operating system-independent type for inter-application (and inter-thread) messages.

NSPortNameServer

An object-oriented interface to the port registration service used by the distributed objects system.

Deprecated
NSProtocolChecker

An object that restricts the messages that can be sent to another object (referred to as the checker’s delegate).