public void RunServer(IList <string> args) { string port = null; string user = null; string assembly = null; string ipaddress = null; var p = new OptionSet() { { "p|port=", v => port = v }, { "u|user="******"a|assembly=", v => assembly = v }, { "l|listen=", v => ipaddress = v } }; args = p.Parse(args); ServerCommand cmd = new ServerCommand(Environment, args); if (assembly != null) { cmd.ApplicationAssembly = assembly; } if (port != null) { int pt; if (!Int32.TryParse(port, out pt)) { throw new ArgumentException("Port value is not an integer."); } if (pt <= 0) { throw new ArgumentOutOfRangeException("port", "Port must be a positive integer."); } cmd.Port = pt; } if (user != null) { cmd.User = user; } if (ipaddress != null) { cmd.IPAddress = ipaddress; } cmd.Run(); }
public void RunServer(IList<string> args) { string port = null; string user = null; string assembly = null; string ipaddress = null; var p = new OptionSet () { { "p|port=", v => port = v }, { "u|user="******"a|assembly=", v=> assembly = v}, { "l|listen=", v => ipaddress = v } }; args = p.Parse(args); ServerCommand cmd = new ServerCommand (Environment, args); if(assembly != null) { cmd.ApplicationAssembly = assembly; } if (port != null) { int pt; if (!Int32.TryParse (port, out pt)) throw new ArgumentException ("Port value is not an integer."); if (pt <= 0) throw new ArgumentOutOfRangeException ("port", "Port must be a positive integer."); cmd.Port = pt; } if (user != null) cmd.User = user; if (ipaddress != null) cmd.IPAddress = ipaddress; cmd.Run (); }
public void RunServer(IList<string> args) { string port = null; string securePort = null; string certFile = null; string keyFile = null; string user = null; string assembly = null; string ipaddress = null; var p = new OptionSet () { { "p|port=", v => port = v }, { "P|secureport=", v => securePort = v }, { "c|certfile=", v => certFile = v }, { "k|keyfile=", v => keyFile = v }, { "u|user="******"a|assembly=", v=> assembly = v}, { "l|listen=", v => ipaddress = v } }; args = p.Parse(args); ServerCommand cmd = new ServerCommand (Environment, args); if(assembly != null) { cmd.ApplicationAssembly = assembly; } if (port != null) { int pt; if (!Int32.TryParse (port, out pt)) throw new ArgumentException ("Port value is not an integer."); if (pt <= 0) throw new ArgumentOutOfRangeException ("port", "Port must be a positive integer."); cmd.Port = pt; } if (securePort != null) { if (certFile == null) throw new ArgumentException ("Certificate file required for TLS."); if (keyFile == null) throw new ArgumentException ("Certificate private key required for TLS."); int pt; if (!Int32.TryParse (securePort, out pt)) throw new ArgumentException ("Secure port value is not an integer."); if (pt <= 0) throw new ArgumentOutOfRangeException ("secureport", "Secure port must be a positive integer."); cmd.SecurePort = pt; cmd.CertificateFile = certFile; cmd.KeyFile = keyFile; } if (user != null) cmd.User = user; if (ipaddress != null) cmd.IPAddress = ipaddress; cmd.Run (); }
public void RunServer(IList<string> args) { string port = null; string user = null; var p = new OptionSet () { { "p|port=", v => port = v }, { "u|user="******"Port value is not an integer."); if (pt <= 0) throw new ArgumentOutOfRangeException ("port", "Port must be a positive integer."); cmd.Port = pt; } if (user != null) cmd.User = user; cmd.Run (); }
public void RunServer(IList<string> args) { ServerCommand cmd = new ServerCommand (Environment, args); cmd.Run (); }
public void RunServer(IList <string> args) { string port = null; string securePort = null; string certFile = null; string keyFile = null; string user = null; string assembly = null; string ipaddress = null; var p = new OptionSet() { { "p|port=", v => port = v }, { "P|secureport=", v => securePort = v }, { "c|certfile=", v => certFile = v }, { "k|keyfile=", v => keyFile = v }, { "u|user="******"a|assembly=", v => assembly = v }, { "l|listen=", v => ipaddress = v } }; args = p.Parse(args); ServerCommand cmd = new ServerCommand(Environment, args); if (assembly != null) { cmd.ApplicationAssembly = assembly; } if (port != null) { int pt; if (!Int32.TryParse(port, out pt)) { throw new ArgumentException("Port value is not an integer."); } if (pt <= 0) { throw new ArgumentOutOfRangeException("port", "Port must be a positive integer."); } cmd.Port = pt; } if (securePort != null) { if (certFile == null) { throw new ArgumentException("Certificate file required for TLS."); } if (keyFile == null) { throw new ArgumentException("Certificate private key required for TLS."); } int pt; if (!Int32.TryParse(securePort, out pt)) { throw new ArgumentException("Secure port value is not an integer."); } if (pt <= 0) { throw new ArgumentOutOfRangeException("secureport", "Secure port must be a positive integer."); } cmd.SecurePort = pt; cmd.CertificateFile = certFile; cmd.KeyFile = keyFile; } if (user != null) { cmd.User = user; } if (ipaddress != null) { cmd.IPAddress = ipaddress; } cmd.Run(); }