|
ctrlX Data Layer .NET API
4.3.0
|
![]() |
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. | |
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}";
|
inline |
Initializes a new instance of the Remote class.
protocolScheme | The communication protocol scheme |
ip | The IP address of the ctrlX CORE. |
user | The user name. |
password | The user password. |
sslPort | The port number of the SSL connection. |
port | The port number of connection. |
ArgumentNullException | Argument cannot be null. |
ArgumentException | Invalid arguments. |
Definition at line 100 of file Remote.cs.
References Remote.Ip, Remote.Password, Remote.Port, Remote.SslPort, and Remote.User.
|
inline |
Creates the remote connection string for TCP or IPC.
Definition at line 118 of file Remote.cs.
References Remote.Protocol, and DatalayerSystem.ProtocolSchemeIpc.
|
get |
Gets the IP address of the ctrlX CORE.
Definition at line 62 of file Remote.cs.
Referenced by Remote.Remote().
|
get |
|
get |
Gets the port number of the connection.
Definition at line 77 of file Remote.cs.
Referenced by Remote.Remote().
|
get |
The communication protocol scheme scheme.
Definition at line 134 of file Remote.cs.
Referenced by Remote.ToString().
|
get |
Gets the port number of the SSL connection.
Definition at line 82 of file Remote.cs.
Referenced by Remote.Remote().
|
get |