62 public string Ip {
get;
private set; }
67 public string User {
get;
private set; }
77 public int?
Port {
get;
private set; }
100 public Remote(
ProtocolScheme protocolScheme =
ProtocolScheme.AUTO,
string ip =
"192.168.1.1",
string user =
"boschrexroth",
string password =
"boschrexroth",
int sslPort = 443,
int? port =
null)
103 Ip = ip ??
throw new ArgumentNullException(nameof(ip));
104 User = user ??
throw new ArgumentNullException(nameof(user));
105 Password = password ??
throw new ArgumentNullException(nameof(password));
110 Port = port >= 0 ? port.Value :
throw new ArgumentException(
"invalid port");
125 return !Port.HasValue ?
126 $
"{Protocol}{User}:{Password}@{Ip}?sslport={SslPort}" :
127 $
"{Protocol}{User}:{Password}@{Ip}:{Port.Value}?sslport={SslPort}";
141 return AutodetectProtocol();
147 throw new NotSupportedException(
"Unknown protocol scheme");
156 private static string AutodetectProtocol()
158 if (Environment.GetEnvironmentVariable(
"SNAP") !=
null &&
159 Environment.GetEnvironmentVariable(
"SNAP_NAME") !=
"dotnet-sdk")
164 return DatalayerSystem.ProtocolSchemeTcp;
Provides the implementation for IDatalayerSystem.
static readonly string ProtocolSchemeTcp
Gets the protocol scheme for TCP communication. Recommended to connect to a DatalayerSystem not runni...
static readonly string ProtocolSchemeIpc
Gets the protocol scheme for IPC communication. Recommended to connect to a DatalayerSystem running o...
Provides a container for a TCP remote connection string.
string Protocol
The communication protocol scheme scheme.
int SslPort
Gets the port number of the SSL connection.
int? Port
Gets the port number of the connection.
string Password
Gets the user password.
string User
Gets the user name.
override string ToString()
Creates the remote connection string for TCP or IPC.
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.
string Ip
Gets the IP address of the ctrlX CORE.