UnixSocket.socket

Creates a socket endpoint for communication and sets this.fd to the corresponding file descriptor.

class UnixSocket
int
socket
(
int type = SOCK_STREAM
)

Parameters

type int

desired socket type, which specifies the communication semantics. Defaults to SOCK_STREAM.

For Unix Sockets the valid types are:

- SOCK_STREAM, for a stream-oriented socket.

- SOCK_DGRAM, for a datagram-oriented socket that preserves message boundaries (as on most UNIX implemen‐tations, UNIX domain datagram sockets are always reliable and don't reorder datagrams).

- SOCK_SEQPACKET (since Linux 2.6.4), for a connection-oriented socket that preserves message boundaries and delivers messages in the order that they were sent.

Return Value

Type: int

The socket descriptor or -1 on error. See the ISocket socket() implementation for details.

Meta