CONSTRUCTOR
new $server
The single-argument constructor can be invoked with a scalar containing the host name of the Rserve
server. The method will immediately open a connection to the server using IO::Socket::INET and
perform the initial steps prescribed by the protocol. The method will raise an exception if the
connection cannot be established or if the remote host does not appear to run the correct version of
Rserve.
new $handle
The single-argument constructor can be invoked with an instance of IO::Handle containing the
connection to the Rserve server, which becomes the 'fh' attribute. The caller is responsible for
ensuring that the connection is established and ready for submitting client requests.
new ATTRIBUTE_HASH_OR_HASH_REF
The constructor's arguments can also be given as a hash or hash reference, specifying values of the
object attributes. The caller passing the handle is responsible for ensuring that the connection is
established and ready for submitting client requests.
new The no-argument constructor uses the default server name 'localhost' and port 6311 and immediately
opens a connection to the server using IO::Socket::INET, performing the initial steps prescribed by
the protocol. The method will raise an exception if the connection cannot be established or if the
remote host does not appear to run the correct version of Rserve.
ACCESSORS
server
Name of the Rserve server.
port
Port of the Rserve server.
fh A connection handle (stored as a reference to the IO::Handle) to the Rserve server.
METHODS
eval EXPR
Evaluates an R expression, given as text string in REXPR, on an Rserve
<http://www.rforge.net/Rserve/> server and returns its result as a Statistics::R::REXP object.
ser_eval EXPR
Evaluates an R expression, given as text string in REXPR, on an Rserve
<http://www.rforge.net/Rserve/> server and returns its result as a Statistics::R::REXP object. This
method uses the CMD_serEval Rserve command (code 0xf5), which is designated as "internal/special" and
"should not be used by clients". Consequently, it is not recommended to use this method in a
production environment, but only to help debug cases where "eval" isn't working as desired.
get_file REMOTE_NAME [, LOCAL_NAME]
Transfers a file named REMOTE_NAME from the Rserve server to the local machine, copying it to
LOCAL_NAME if it is specified. The file is transferred in binary mode. Returns the contents of the
file as a scalar.
close
Closes the object's filehandle. This method is automatically invoked when the object is destroyed if
the connection was opened by the constructor, but not if it was passed in as a pre-opened handle.