socket_setup.RdCreate a POSIX socket.
socket_create(
domain = c("inet", "inet6", "unix"),
type = c("stream", "dgram"),
protocol = 0L,
nonblocking = FALSE,
cloexec = TRUE
)
socket_bind(socket, address = NULL, port = NULL)
socket_listen(socket, backlog = 128L)
socket_accept(socket, nonblocking = NULL)
socket_connect(socket, address, port = NULL)Address family: "inet", "inet6", or "unix".
Socket type: "stream" or "dgram".
Numeric protocol, usually zero.
Whether the accepted socket should be nonblocking; NULL
inherits the listener mode.
Whether to set close-on-exec.
A socketR socket handle.
A hostname, IP address, or Unix-domain path.
A port between 0 and 65535; NULL for Unix sockets.
Maximum pending connection queue length.
A socketR external-pointer handle.
Invisibly, the socket handle.
Invisibly, the socket handle.
A socket handle, or NULL when no connection is pending.
TRUE when connected, or FALSE when connection is in progress.
if (.Platform$OS.type != "windows") {
s <- socket_create()
socket_close(s)
}