| 78 | private readonly TConfiguration Configuration = new(); |
| 79 | |
| 80 | internal void Parse(List<string> args) |
| 81 | { |
| 82 | for (var i = 0; i < args.Count; ++i) |
| 83 | { |
| 84 | if (args[i] == "-u") |
| 85 | { |
| 86 | url = args[++i]; |
| 87 | transport = TransportChoice.Http; |
| 88 | } |
| 89 | else if (args[i] == "-n") |
| 90 | { |
| 91 | numIterations = Convert.ToInt32(args[++i]); |
| 92 | } |
| 93 | else if (args[i].StartsWith("--pipe=")) |
| 94 | { |
| 95 | pipe = args[i].Substring(args[i].IndexOf('=') + 1); |
| 96 | transport = TransportChoice.NamedPipe; |
| 97 | } |
| 98 | else if (args[i].StartsWith("--host=")) |
| 99 | { |
| 100 | // check there for ipaddress |
| 101 | host = args[i].Substring(args[i].IndexOf('=') + 1); |
| 102 | if (transport != TransportChoice.TlsSocket) |
| 103 | transport = TransportChoice.Socket; |
| 104 | } |
| 105 | else if (args[i].StartsWith("--port=")) |
| 106 | { |
| 107 | port = int.Parse(args[i].Substring(args[i].IndexOf('=') + 1)); |
| 108 | if (transport != TransportChoice.TlsSocket) |
| 109 | transport = TransportChoice.Socket; |
| 110 | } |
| 111 | else if (args[i] == "-b" || args[i] == "--buffered" || args[i] == "--transport=buffered") |
| 112 | { |
| 113 | layered = LayeredChoice.Buffered; |
| 114 | } |
| 115 | else if (args[i] == "-f" || args[i] == "--framed" || args[i] == "--transport=framed") |
| 116 | { |
| 117 | layered = LayeredChoice.Framed; |
| 118 | } |
| 119 | else if (args[i] == "-t") |
| 120 | { |
| 121 | numThreads = Convert.ToInt32(args[++i]); |
| 122 | } |
| 123 | else if (args[i] == "--binary" || args[i] == "--protocol=binary") |
| 124 | { |
| 125 | protocol = ProtocolChoice.Binary; |
| 126 | } |
| 127 | else if (args[i] == "--compact" || args[i] == "--protocol=compact") |
| 128 | { |
| 129 | protocol = ProtocolChoice.Compact; |
| 130 | } |
| 131 | else if (args[i] == "--json" || args[i] == "--protocol=json") |
| 132 | { |
| 133 | protocol = ProtocolChoice.Json; |
| 134 | } |
| 135 | else if (args[i] == "--ssl") |
| 136 | { |
| 137 | transport = TransportChoice.TlsSocket; |