Instance Method

initWithProtocolFamily:socketType:protocol:socket:

Initializes the receiver with a previously created local socket.

Declaration

- (instancetype)initWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol socket:(NSSocketNativeHandle)sock;

Parameters

family

The protocol family for the provided socket. Possible values are defined in <sys/socket.h>, such as AF_LOCAL, AF_INET, and AF_INET6.

type

The type of the provided socket.

protocol

The specific protocol the provided socket uses.

sock

The previously created socket.

Return Value

A local socket port initialized with the provided socket.

See Also

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.

- 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.