socket_client_connection: Open a connection to a SciViews socket client for write...

View source: R/socket_client_connection.R

socket_client_connectionR Documentation

Open a connection to a SciViews socket client for write access

Description

A 'sockclientconn' object is created that opens a connection from R to a SciViews socket client (that must be currently connected). A timeout is defined by options(timeout = XX) where XX is a number of seconds. In R, its default value is 60 sec.

Usage

socket_client_connection(
  client,
  server_port = 8888,
  socket,
  blocking = FALSE,
  open = "a",
  encoding = getOption("encoding")
)

## S3 method for class 'sockclientconn'
summary(object, ...)

socketClientConnection(
  client,
  server_port = 8888,
  socket,
  blocking = FALSE,
  open = "a",
  encoding = getOption("encoding")
)

Arguments

client

the client identification. By default, it is the socket identifier as it appears in get_socket_clients(). The client must be currently connected.

server_port

the port on which the server is running, 8888 by default. This server must be currently running.

socket

the Tcl socket name where the targeted client is connected. If not provided, it will be guessed from client, otherwise, client is ignored.

blocking

logical. Should the connection wait that the data is written before exiting?

open

character. How the connection is opened. Currently, only "a" for append (default) or "w" for write access are usable.

encoding

the name of the encoding to use.

object

A 'sockclientconn' object as returned by socket_client_connection().

...

further arguments passed to the method (not used for the moment).

Value

socket_client_connection() creates a 'sockclientconn' object redirects text send to it to the SciViews socket server client. It is inherits from a 'sockconn' object (see socketConnection()), and the only difference is that output is redirected to a Tcl socket corresponding to a given SciViews socket client currently connected.

See Also

socketConnection(), send_socket_clients()


SciViews/svSocket documentation built on March 2, 2024, 5:50 p.m.