ctrlX Data Layer .NET API  4.3.0
Loading...
Searching...
No Matches
Remote Class Reference

Provides a container for a TCP remote connection string. More...

Public Member Functions

 Remote (ProtocolScheme protocolScheme=ProtocolScheme.AUTO, string ip="192.168.1.1", string user="boschrexroth", string password="boschrexroth", int sslPort=443, int? port=null)
 Initializes a new instance of the Remote class.
 
override string ToString ()
 Creates the remote connection string for TCP or IPC.
 

Properties

string Ip [get]
 Gets the IP address of the ctrlX CORE.
 
string Password [get]
 Gets the user password.
 
int? Port [get]
 Gets the port number of the connection.
 
string Protocol [get]
 The communication protocol scheme scheme.
 
ProtocolScheme ProtocolScheme [get]
 Gets the communication protocol scheme.
 
int SslPort [get]
 Gets the port number of the SSL connection.
 
string User [get]
 Gets the user name.
 

Detailed Description

Provides a container for a TCP remote connection string.

For ease of use, the default values for IP address, user, password and SSL port are chosen to match the settings of a newly created ctrlX CORE device:

Ip="192.168.1.1" User="boschrexroth" Password="boschrexroth" SslPort=443

with these variables, the tcp connection string can be formatted as follows:

tcp://{User}:{Password}Ip}?Sslport={sslPort}

If these values do not suit your use case, explicitly pass the parameters that require different values.

Here some examples:

1. ctrlX CORE or ctrlX CORE virtual with another IP address, user and password:

var remote = new Remote(ip: "192.168.1.100", user: "admin", password: "-$_U/{X$aG}Z3/e<");

2. ctrlX CORE virtual with port forwarding running on the same host as the app build environment (QEMU VM):

var remote = new Remote(ip: "10.0.2.2", sslPort: 8443)

Remarks: 10.0.2.2 is the IP address of the host from the point of view of the app build environment(QEMU VM). 8443 is the host SSL port, which is forwarded to the SSL port (defaults to 443) of the ctrlX CORE virtual

3. ctrlX CORE virtual with port forwarding running on windows build environment (MS Visual Studio):

var remote = new Remote(ip: "127.0.0.1", sslPort: 8443);

Remarks: 127.0.0.1 is the IP address of the ctrlX virtual on the windows host system. 8443 is the host SSL port, which is forwarded to the SSL port (defaults to 443) of the ctrlX CORE virtual

IMPORTANT: You don't need to change the parameter settings, before building a snap and installing the snap on a ctrlX CORE. The Remote util detects the snap environment and uses automatically inter process communication "ipc://". If you don't wan't to communicate to localhost (e.g. C2C), build up the remote string manually in the following form (SSL port defaults to 443 and is optional):

var remote = $"{DatalayerSystem.ProtocolSchemeTcp}{User}:{Password}@{Ip}?sslport={SslPort}";

If you have a special port, different from the default one (e.g. for port forwarding), set the port and build up the remote string manually in the following form (SSL port defaults to 443 and is optional):

var remote = $"{DatalayerSystem.ProtocolSchemeTcp}{User}:{Password}@{Ip}:{Port}?sslport={SslPort}";

Definition at line 57 of file Remote.cs.

Constructor & Destructor Documentation

◆ Remote()

Remote ( ProtocolScheme  protocolScheme = ProtocolScheme::AUTO,
string  ip = "192.168.1.1",
string  user = "boschrexroth",
string  password = "boschrexroth",
int  sslPort = 443,
int?  port = null 
)
inline

Initializes a new instance of the Remote class.

Parameters
protocolSchemeThe communication protocol scheme
ipThe IP address of the ctrlX CORE.
userThe user name.
passwordThe user password.
sslPortThe port number of the SSL connection.
portThe port number of connection.
Exceptions
ArgumentNullExceptionArgument cannot be null.
ArgumentExceptionInvalid arguments.

Definition at line 100 of file Remote.cs.

References Remote.Ip, Remote.Password, Remote.Port, Remote.SslPort, and Remote.User.

Member Function Documentation

◆ ToString()

override string ToString ( )
inline

Creates the remote connection string for TCP or IPC.

Returns
The remote connection string

Definition at line 118 of file Remote.cs.

References Remote.Protocol, and DatalayerSystem.ProtocolSchemeIpc.

Property Documentation

◆ Ip

string Ip
get

Gets the IP address of the ctrlX CORE.

Definition at line 62 of file Remote.cs.

Referenced by Remote.Remote().

◆ Password

string Password
get

Gets the user password.

Definition at line 72 of file Remote.cs.

Referenced by Remote.Remote().

◆ Port

int? Port
get

Gets the port number of the connection.

Definition at line 77 of file Remote.cs.

Referenced by Remote.Remote().

◆ Protocol

string Protocol
get

The communication protocol scheme scheme.

Returns
The current protocol scheme

Definition at line 134 of file Remote.cs.

Referenced by Remote.ToString().

◆ ProtocolScheme

Gets the communication protocol scheme.

Definition at line 87 of file Remote.cs.

◆ SslPort

int SslPort
get

Gets the port number of the SSL connection.

Definition at line 82 of file Remote.cs.

Referenced by Remote.Remote().

◆ User

string User
get

Gets the user name.

Definition at line 67 of file Remote.cs.

Referenced by Remote.Remote().


The documentation for this class was generated from the following file: