Class

NSSocketPort

A port that represents a BSD socket.

Declaration

@interface NSSocketPort : NSPort

Overview

A NSSocketPort object can be used as an endpoint for distributed object connections. Companion classes, NSMachPort and NSMessagePort, allow for local (on the same machine) communication only. The NSSocketPort class allows for both local and remote communication, but may be more expensive than the others for the local case.

Topics

Creating Instances

init

Initializes the receiver as a local TCP/IP socket of type SOCK_STREAM.

initWithTCPPort:

Initializes the receiver as a local TCP/IP socket of type SOCK_STREAM, listening on a specified port number.

initWithProtocolFamily:socketType:protocol:address:

Initializes the receiver as a local socket with the provided arguments.

initWithProtocolFamily:socketType:protocol:socket:

Initializes the receiver with a previously created local socket.

initRemoteWithTCPPort:host:

Initializes the receiver as a TCP/IP socket of type SOCK_STREAM that can connect to a remote host on a specified port.

initRemoteWithProtocolFamily:socketType:protocol:address:

Initializes the receiver as a remote socket with the provided arguments.

Getting Information

address

The receiver’s socket address structure stored inside an NSData object.

protocol

The protocol that the receiver uses for communication.

protocolFamily

The protocol family that the receiver uses for communication.

socket

The receiver’s native socket identifier on the platform.

socketType

The receiver’s socket type.

Relationships

Inherits From

See Also

Sockets

NSHost

A representation of an individual host on the network.

NSPort

An abstract class that represents a communication channel.