conn_create_unix_socket {processx}R Documentation

Unix domain sockets

Description

[Experimental]

Cross platform point-to-point inter-process communication with Unix=domain sockets, implemented via named pipes on Windows. These connection are always bidirectional, i.e. you can read from them and also write to them.

Usage

conn_create_unix_socket(filename = NULL, encoding = "")

conn_connect_unix_socket(filename, encoding = "")

conn_accept_unix_socket(con)

conn_unix_socket_state(con)

Arguments

filename

File name of the socket. On Windows it the name of the pipe within the ⁠\\?\pipe\⁠ namespace, either the full name, or the part after that prefix. If NULL, then a random name is used, on Unix in the R temporary directory: base::tempdir().

encoding

Encoding to assume when reading from the socket.

con

Connection. An error is thrown if not a socket connection.

Details

conn_create_unix_socket() creates a server socket. The new socket is listening at filename. See filename above.

conn_connect_unix_socket() creates a client socket and connects it to a server socket.

conn_accept_unix_socket() accepts a client connection at a server socket.

conn_unix_socket_state() returns the state of the socket. Currently it can return: "listening", "connected_server", "connected_client". It is possible that other states (e.g. for a closed socket) will be added in the future.

Notes

Value

A new socket connection.

See Also

processx internals


[Package processx version 3.8.4 Index]