Exemplo n.º 1
0
 /// <summary>
 /// Write a file to the server.
 /// Note: It'd be better to return a Stream object to be written to, but Rserve doesn't seem to support an asynchronous connection
 /// for file reading and writing.
 /// </summary>
 /// <param name="fileName">
 /// Name of the file to be written. Avoid jumping across directories.
 /// </param>
 /// <param name="data">
 /// Data to be written to the file
 /// </param>
 public void WriteFile(string fileName, Stream data) =>
 Async.RunSynchronously(WriteFileAsync(fileName, data));
Exemplo n.º 2
0
 /// <summary>
 /// Attempt to shut down the server process cleanly.
 /// This command is asynchronous!
 /// </summary>
 public void ServerShutdown() => Async.RunSynchronously(ServerShutdownAsync());
Exemplo n.º 3
0
 /// <summary>
 /// Delete a file from the server
 /// </summary>
 /// <param name="fileName">
 /// Name of the file to be deleted
 /// </param>
 public void RemoveFile(string fileName) =>
 Async.RunSynchronously(RemoveFileAsync(fileName));
Exemplo n.º 4
0
 /// <summary>
 /// Evaluate an R command and don't return the result (for efficiency)
 /// </summary>
 /// <param name="s">
 /// R command tp be evaluated
 /// </param>
 public void VoidEval(string s) =>
 Async.RunSynchronously(VoidEvalAsync(s));
Exemplo n.º 5
0
 /// <summary>
 /// Evaluate an R command and return the result. this[string] is syntactic sugar for the same operation.
 /// </summary>
 /// <param name="s">
 /// Command to be evaluated
 /// </param>
 /// <returns>
 /// Sexp that resulted from the command
 /// </returns>
 public Sexp Eval(string s) =>
 Async.RunSynchronously(EvalAsync(s));
Exemplo n.º 6
0
 /// <summary>
 /// Read a file from the server
 /// </summary>
 /// <param name="fileName">
 /// Name of the file to be read. Avoid jumping across directories.
 /// </param>
 /// <returns>
 /// Stream with the file data.
 /// </returns>
 public Stream ReadFile(string fileName) =>
 Async.RunSynchronously(ReadFileAsync(fileName));
Exemplo n.º 7
0
 /// <summary>
 /// Assign an R variable on the server. this[symbol] = value is syntactic sugar for this operation.
 /// </summary>
 /// <param name="symbol">
 /// Variable name
 /// </param>
 /// <param name="val">
 /// Sexp to be assigned to the variable
 /// </param>
 public void Assign(string symbol, Sexp val) =>
 Async.RunSynchronously(AssignAsync(symbol, val));
Exemplo n.º 8
0
 /// <summary>
 /// Connects to Rserve identified by an IP address.
 /// </summary>
 /// <param name="addr">
 /// Address of the Rserve server, or nothing for localhost
 /// </param>
 /// <param name="port">
 /// Port on which the server listens
 /// </param>
 /// <param name="credentials">
 /// Credentials for authentication or <c>null</c> for anonymous
 /// </param>
 public static RConnection Connect(IPAddress addr = null, int port = 6311, NetworkCredential credentials = null) =>
 Async.RunSynchronously(ConnectAsync(addr, port, credentials));
Exemplo n.º 9
0
 /// <summary>
 /// Connects to Rserve identified by host name.
 /// </summary>
 /// <param name="hostname">
 /// Hostname of the server
 /// </param>
 /// <param name="port">
 /// Port on which Rserve listens
 /// </param>
 /// <param name="credentials">
 /// Credentials for authentication or <c>null</c> for anonymous
 /// </param>
 public static RConnection Connect(string hostname, int port = 6311, NetworkCredential credentials = null) =>
 Async.RunSynchronously(ConnectAsync(hostname, port, credentials));
Exemplo n.º 10
0
 public RConnection(IPAddress addr = null, int port = 6311, string user = null, string password = null) :
     this(Async.RunSynchronously(ConnectAsync(addr, port, CreateNetworkCredential(user, password))))
 {
 }
Exemplo n.º 11
0
 public RConnection(string hostname, int port = 6311, string user = null, string password = null) :
     this(Async.RunSynchronously(ConnectAsync(hostname, port, CreateNetworkCredential(user, password))))
 {
 }