blob: 082e767f3d55a507ba4704d062aa16ec872e133b [file] [log] [blame]
Jens Geyeraa0c8b32019-01-28 23:27:45 +01001// Licensed to the Apache Software Foundation(ASF) under one
2// or more contributor license agreements.See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
Jens Geyere26b4a82024-11-12 23:53:04 +010018using Microsoft.Extensions.Logging;
Jens Geyeraa0c8b32019-01-28 23:27:45 +010019using System;
Mario Emmenlauer47e49232020-04-07 18:43:46 +020020using System.Diagnostics;
Jens Geyeraa0c8b32019-01-28 23:27:45 +010021using System.IO;
22using System.Linq;
23using System.Net;
24using System.Net.Security;
25using System.Security.Cryptography.X509Certificates;
26using System.Threading;
27using System.Threading.Tasks;
Jens Geyeraa0c8b32019-01-28 23:27:45 +010028using Thrift;
29using Thrift.Protocol;
30using Thrift.Transport;
31using Thrift.Transport.Client;
32using tutorial;
Jens Geyeraa0c8b32019-01-28 23:27:45 +010033
Jens Geyer0d128322021-02-25 09:42:52 +010034#pragma warning disable IDE0057 // substr
35
Jens Geyeraa0c8b32019-01-28 23:27:45 +010036namespace Client
37{
Jens Geyer4c7b9fd2021-12-04 22:48:37 +010038 public static class LoggingHelper
39 {
40 public static ILoggerFactory LogFactory { get; } = LoggerFactory.Create(builder => {
41 ConfigureLogging(builder);
42 });
43
44 public static void ConfigureLogging(ILoggingBuilder logging)
45 {
46 logging.SetMinimumLevel(LogLevel.Trace);
47 logging.AddConsole();
48 logging.AddDebug();
49 }
50
51 public static ILogger<T> CreateLogger<T>() => LogFactory.CreateLogger<T>();
52 }
53
Jens Geyeraa0c8b32019-01-28 23:27:45 +010054 public class Program
55 {
Jens Geyer4c7b9fd2021-12-04 22:48:37 +010056 private static readonly ILogger Logger = LoggingHelper.CreateLogger<Program>();
Jens Geyere26b4a82024-11-12 23:53:04 +010057 private static readonly TConfiguration Configuration = new();
Jens Geyeraa0c8b32019-01-28 23:27:45 +010058
59 private static void DisplayHelp()
60 {
61 Logger.LogInformation(@"
62Usage:
Kengo Sekibee4f2f2019-12-29 17:04:50 +090063 Client -help
Jens Geyeraa0c8b32019-01-28 23:27:45 +010064 will diplay help information
65
Jens Geyer0d128322021-02-25 09:42:52 +010066 Client -tr:<transport> -bf:<buffering> -pr:<protocol> [-mc:<numClients>] [-multiplex]
Jens Geyeraa0c8b32019-01-28 23:27:45 +010067 will run client with specified arguments (tcp transport and binary protocol by default) and with 1 client
68
69Options:
70 -tr (transport):
Jens Geyer0d128322021-02-25 09:42:52 +010071 tcp - (default) tcp transport (localhost:9090)
72 tcptls - tcp tls transport (localhost:9090)
73 namedpipe - namedpipe transport (pipe "".test"")
74 http - http transport (http://localhost:9090)
Kyle Smith7b94dd42019-03-23 17:26:56 +010075
76 -bf (buffering):
Jens Geyer0d128322021-02-25 09:42:52 +010077 none - (default) no buffering
78 buffered - buffered transport
79 framed - framed transport
Jens Geyeraa0c8b32019-01-28 23:27:45 +010080
81 -pr (protocol):
Jens Geyer0d128322021-02-25 09:42:52 +010082 binary - (default) binary protocol
83 compact - compact protocol
84 json - json protocol
85
86 -multiplex - adds multiplexed protocol
Jens Geyeraa0c8b32019-01-28 23:27:45 +010087
88 -mc (multiple clients):
89 <numClients> - number of multiple clients to connect to server (max 100, default 1)
90
91Sample:
Kengo Sekibee4f2f2019-12-29 17:04:50 +090092 Client -tr:tcp -pr:binary
Jens Geyeraa0c8b32019-01-28 23:27:45 +010093");
94 }
95
Jens Geyere26b4a82024-11-12 23:53:04 +010096 public static async Task Main(string[] args)
Jens Geyeraa0c8b32019-01-28 23:27:45 +010097 {
Jens Geyere26b4a82024-11-12 23:53:04 +010098 args ??= [];
Jens Geyeraa0c8b32019-01-28 23:27:45 +010099
Jens Geyere26b4a82024-11-12 23:53:04 +0100100 // -help is rather unusual but we leave it for compatibility
101 if (args.Any(x => x.Equals("-help") || x.Equals("--help") || x.Equals("-h") || x.Equals("-?")))
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100102 {
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100103 DisplayHelp();
104 return;
105 }
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100106
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100107 Logger.LogInformation("Starting client...");
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100108
Jens Geyere26b4a82024-11-12 23:53:04 +0100109 using var source = new CancellationTokenSource();
110 await RunAsync(args, source.Token);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100111 }
112
Jens Geyer4c7b9fd2021-12-04 22:48:37 +0100113
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100114 private static async Task RunAsync(string[] args, CancellationToken cancellationToken)
115 {
116 var numClients = GetNumberOfClients(args);
117
Jens Geyer2f214c22025-11-13 23:24:45 +0100118 if (Logger.IsEnabled(LogLevel.Information))
119 Logger.LogInformation("Selected # of clients: {numClients}", numClients);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100120
Jens Geyer0d128322021-02-25 09:42:52 +0100121 var transport = GetTransport(args);
Jens Geyer2f214c22025-11-13 23:24:45 +0100122 if (Logger.IsEnabled(LogLevel.Information))
123 Logger.LogInformation("Selected client transport: {transport}", transport);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100124
Jens Geyer0d128322021-02-25 09:42:52 +0100125 var protocol = MakeProtocol( args, MakeTransport(args));
Jens Geyer2f214c22025-11-13 23:24:45 +0100126 if (Logger.IsEnabled(LogLevel.Information))
127 Logger.LogInformation("Selected client protocol: {GetProtocol(args)}", GetProtocol(args));
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100128
Jens Geyer0d128322021-02-25 09:42:52 +0100129 var mplex = GetMultiplex(args);
Jens Geyer2f214c22025-11-13 23:24:45 +0100130 if (Logger.IsEnabled(LogLevel.Information))
131 Logger.LogInformation("Multiplex {mplex}", mplex);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100132
133 var tasks = new Task[numClients];
134 for (int i = 0; i < numClients; i++)
135 {
Jens Geyer0d128322021-02-25 09:42:52 +0100136 var task = RunClientAsync(protocol, mplex, cancellationToken);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100137 tasks[i] = task;
138 }
139
Jens Geyer2f214c22025-11-13 23:24:45 +0100140 Task.WaitAll(tasks, cancellationToken);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100141 }
142
Jens Geyer0d128322021-02-25 09:42:52 +0100143 private static bool GetMultiplex(string[] args)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100144 {
Jens Geyer0d128322021-02-25 09:42:52 +0100145 var mplex = args.FirstOrDefault(x => x.StartsWith("-multiplex"));
146 return !string.IsNullOrEmpty(mplex);
147 }
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100148
Jens Geyer0d128322021-02-25 09:42:52 +0100149 private static Protocol GetProtocol(string[] args)
150 {
Jens Geyere26b4a82024-11-12 23:53:04 +0100151 var protocol = args.FirstOrDefault(x => x.StartsWith("-pr"))?.Split(':').Skip(1).Take(1).FirstOrDefault();
Jens Geyer0d128322021-02-25 09:42:52 +0100152 if (string.IsNullOrEmpty(protocol))
153 return Protocol.Binary;
154
155 protocol = protocol.Substring(0, 1).ToUpperInvariant() + protocol.Substring(1).ToLowerInvariant();
156 if (Enum.TryParse(protocol, true, out Protocol selectedProtocol))
157 return selectedProtocol;
158 else
159 return Protocol.Binary;
160 }
161
162 private static Buffering GetBuffering(string[] args)
163 {
Jens Geyere26b4a82024-11-12 23:53:04 +0100164 var buffering = args.FirstOrDefault(x => x.StartsWith("-bf"))?.Split(':').Skip(1).Take(1).FirstOrDefault();
Jens Geyer0d128322021-02-25 09:42:52 +0100165 if (string.IsNullOrEmpty(buffering))
166 return Buffering.None;
167
168 buffering = buffering.Substring(0, 1).ToUpperInvariant() + buffering.Substring(1).ToLowerInvariant();
169 if (Enum.TryParse<Buffering>(buffering, out var selectedBuffering))
170 return selectedBuffering;
171 else
172 return Buffering.None;
173 }
174
175 private static Transport GetTransport(string[] args)
176 {
Jens Geyere26b4a82024-11-12 23:53:04 +0100177 var transport = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':').Skip(1).Take(1).FirstOrDefault();
Jens Geyer0d128322021-02-25 09:42:52 +0100178 if (string.IsNullOrEmpty(transport))
179 return Transport.Tcp;
180
181 transport = transport.Substring(0, 1).ToUpperInvariant() + transport.Substring(1).ToLowerInvariant();
182 if (Enum.TryParse(transport, true, out Transport selectedTransport))
183 return selectedTransport;
184 else
185 return Transport.Tcp;
186 }
187
188
189 private static TTransport MakeTransport(string[] args)
190 {
Kyle Smith7b94dd42019-03-23 17:26:56 +0100191 // construct endpoint transport
Jens Geyere26b4a82024-11-12 23:53:04 +0100192 TTransport? transport = null;
Jens Geyer0d128322021-02-25 09:42:52 +0100193 Transport selectedTransport = GetTransport(args);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100194 {
195 switch (selectedTransport)
196 {
197 case Transport.Tcp:
Jens Geyereacd1d42019-11-20 19:03:14 +0100198 transport = new TSocketTransport(IPAddress.Loopback, 9090, Configuration);
Kyle Smith7b94dd42019-03-23 17:26:56 +0100199 break;
200
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100201 case Transport.NamedPipe:
Jens Geyereacd1d42019-11-20 19:03:14 +0100202 transport = new TNamedPipeTransport(".test", Configuration);
Kyle Smith7b94dd42019-03-23 17:26:56 +0100203 break;
204
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100205 case Transport.Http:
Jens Geyereacd1d42019-11-20 19:03:14 +0100206 transport = new THttpTransport(new Uri("http://localhost:9090"), Configuration);
Kyle Smith7b94dd42019-03-23 17:26:56 +0100207 break;
208
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100209 case Transport.TcpTls:
Jens Geyereacd1d42019-11-20 19:03:14 +0100210 transport = new TTlsSocketTransport(IPAddress.Loopback, 9090, Configuration,
211 GetCertificate(), CertValidator, LocalCertificateSelectionCallback);
Kyle Smith7b94dd42019-03-23 17:26:56 +0100212 break;
213
214 default:
215 Debug.Assert(false, "unhandled case");
216 break;
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100217 }
218 }
219
Kyle Smith7b94dd42019-03-23 17:26:56 +0100220 // optionally add layered transport(s)
Jens Geyer0d128322021-02-25 09:42:52 +0100221 Buffering selectedBuffering = GetBuffering(args);
222 switch (selectedBuffering)
Kyle Smith7b94dd42019-03-23 17:26:56 +0100223 {
Jens Geyer0d128322021-02-25 09:42:52 +0100224 case Buffering.Buffered:
225 transport = new TBufferedTransport(transport);
226 break;
Kyle Smith7b94dd42019-03-23 17:26:56 +0100227
Jens Geyer0d128322021-02-25 09:42:52 +0100228 case Buffering.Framed:
229 transport = new TFramedTransport(transport);
230 break;
Kyle Smith7b94dd42019-03-23 17:26:56 +0100231
Jens Geyer0d128322021-02-25 09:42:52 +0100232 default: // layered transport(s) are optional
233 Debug.Assert(selectedBuffering == Buffering.None, "unhandled case");
234 break;
Kyle Smith7b94dd42019-03-23 17:26:56 +0100235 }
236
237 return transport;
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100238 }
239
240 private static int GetNumberOfClients(string[] args)
241 {
Jens Geyere26b4a82024-11-12 23:53:04 +0100242 var numClients = args.FirstOrDefault(x => x.StartsWith("-mc"))?.Split(':').Skip(1).Take(1).FirstOrDefault();
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100243
Jens Geyer2f214c22025-11-13 23:24:45 +0100244 if (Logger.IsEnabled(LogLevel.Information))
245 Logger.LogInformation("Selected # of clients: {numClients}", numClients);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100246
Jens Geyer0d128322021-02-25 09:42:52 +0100247 if (int.TryParse(numClients, out int c) && (0 < c) && (c <= 100))
248 return c;
249 else
250 return 1;
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100251 }
252
253 private static X509Certificate2 GetCertificate()
254 {
255 // due to files location in net core better to take certs from top folder
Jens Geyere26b4a82024-11-12 23:53:04 +0100256 var dir = Directory.GetParent(Directory.GetCurrentDirectory());
257 if (dir != null)
258 {
259 var certFile = GetCertPath(dir);
260 //return new X509Certificate2(certFile, "ThriftTest");
261 return X509CertificateLoader.LoadPkcs12FromFile(certFile, "ThriftTest");
262 }
263 else
264 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100265 if (Logger.IsEnabled(LogLevel.Error))
266 Logger.LogError("Root path of {path} not found", Directory.GetCurrentDirectory());
Jens Geyere26b4a82024-11-12 23:53:04 +0100267 throw new Exception($"Root path of {Directory.GetCurrentDirectory()} not found");
268 }
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100269 }
270
Jens Geyere26b4a82024-11-12 23:53:04 +0100271 private static string GetCertPath(DirectoryInfo? di, int maxCount = 6)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100272 {
273 var topDir = di;
Jens Geyere26b4a82024-11-12 23:53:04 +0100274 var certFile = topDir?.EnumerateFiles("ThriftTest.pfx", SearchOption.AllDirectories).FirstOrDefault();
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100275 if (certFile == null)
276 {
277 if (maxCount == 0)
278 throw new FileNotFoundException("Cannot find file in directories");
Jens Geyere26b4a82024-11-12 23:53:04 +0100279 return GetCertPath(di?.Parent, --maxCount);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100280 }
281
282 return certFile.FullName;
283 }
284
Jens Geyere26b4a82024-11-12 23:53:04 +0100285 private static X509Certificate2 LocalCertificateSelectionCallback(object sender,
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100286 string targetHost, X509CertificateCollection localCertificates,
Jens Geyere26b4a82024-11-12 23:53:04 +0100287 X509Certificate? remoteCertificate, string[] acceptableIssuers)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100288 {
289 return GetCertificate();
290 }
291
Jens Geyere26b4a82024-11-12 23:53:04 +0100292 private static bool CertValidator(object sender, X509Certificate? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100293 {
294 return true;
295 }
296
Jens Geyer0d128322021-02-25 09:42:52 +0100297 private static TProtocol MakeProtocol(string[] args, TTransport transport)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100298 {
Jens Geyer0d128322021-02-25 09:42:52 +0100299 Protocol selectedProtocol = GetProtocol(args);
Jens Geyer2b2ea622021-04-09 22:55:11 +0200300 return selectedProtocol switch
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100301 {
Jens Geyer2b2ea622021-04-09 22:55:11 +0200302 Protocol.Binary => new TBinaryProtocol(transport),
303 Protocol.Compact => new TCompactProtocol(transport),
304 Protocol.Json => new TJsonProtocol(transport),
305 _ => throw new Exception("unhandled protocol"),
306 };
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100307 }
308
Jens Geyer0d128322021-02-25 09:42:52 +0100309 private static async Task RunClientAsync(TProtocol protocol, bool multiplex, CancellationToken cancellationToken)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100310 {
311 try
312 {
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100313 try
314 {
Jens Geyer0d128322021-02-25 09:42:52 +0100315 if( multiplex)
316 protocol = new TMultiplexedProtocol(protocol, nameof(Calculator));
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100317
Jens Geyer0d128322021-02-25 09:42:52 +0100318 var client = new Calculator.Client(protocol);
319 await ExecuteCalculatorClientOperations(client, cancellationToken);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100320 }
321 catch (Exception ex)
322 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100323 if (Logger.IsEnabled(LogLevel.Error))
324 Logger.LogError("{ex}",ex);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100325 }
326 finally
327 {
328 protocol.Transport.Close();
329 }
330 }
331 catch (TApplicationException x)
332 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100333 if (Logger.IsEnabled(LogLevel.Error))
334 Logger.LogError("{x}",x);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100335 }
336 }
337
Jens Geyer0d128322021-02-25 09:42:52 +0100338 private static async Task ExecuteCalculatorClientOperations( Calculator.Client client, CancellationToken cancellationToken)
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100339 {
340 await client.OpenTransportAsync(cancellationToken);
341
Jens Geyer2f214c22025-11-13 23:24:45 +0100342 if (Logger.IsEnabled(LogLevel.Information))
343 Logger.LogInformation("{client.ClientId} Ping()", client.ClientId);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100344
Jens Geyer2b2ea622021-04-09 22:55:11 +0200345 await client.ping(cancellationToken);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100346
Jens Geyer2f214c22025-11-13 23:24:45 +0100347 if (Logger.IsEnabled(LogLevel.Information))
348 Logger.LogInformation("{client.ClientId} Add(1,1)", client.ClientId);
349
Jens Geyer2b2ea622021-04-09 22:55:11 +0200350 var sum = await client.add(1, 1, cancellationToken);
Jens Geyer2f214c22025-11-13 23:24:45 +0100351
352 if (Logger.IsEnabled(LogLevel.Information))
353 Logger.LogInformation("{client.ClientId} Add(1,1)={sum}", client.ClientId, sum);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100354
355 var work = new Work
356 {
357 Op = Operation.DIVIDE,
358 Num1 = 1,
359 Num2 = 0
360 };
361
362 try
363 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100364 if (Logger.IsEnabled(LogLevel.Information))
365 Logger.LogInformation("{client.ClientId} Calculate(1)", client.ClientId);
366
Jens Geyer2b2ea622021-04-09 22:55:11 +0200367 await client.calculate(1, work, cancellationToken);
Jens Geyer2f214c22025-11-13 23:24:45 +0100368
369 if (Logger.IsEnabled(LogLevel.Information))
370 Logger.LogInformation("{client.ClientId} Whoa we can divide by 0", client.ClientId);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100371 }
372 catch (InvalidOperation io)
373 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100374 if (Logger.IsEnabled(LogLevel.Information))
375 Logger.LogInformation("{client.ClientId} Invalid operation: {io}", client.ClientId, io);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100376 }
377
378 work.Op = Operation.SUBTRACT;
379 work.Num1 = 15;
380 work.Num2 = 10;
381
382 try
383 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100384 if (Logger.IsEnabled(LogLevel.Information))
385 Logger.LogInformation("{client.ClientId} Calculate(1)", client.ClientId);
386
Jens Geyer2b2ea622021-04-09 22:55:11 +0200387 var diff = await client.calculate(1, work, cancellationToken);
Jens Geyer2f214c22025-11-13 23:24:45 +0100388
389 if (Logger.IsEnabled(LogLevel.Information))
390 Logger.LogInformation("{client.ClientId} 15-10={diff}", client.ClientId, diff);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100391 }
392 catch (InvalidOperation io)
393 {
Jens Geyer2f214c22025-11-13 23:24:45 +0100394 if (Logger.IsEnabled(LogLevel.Information))
395 Logger.LogInformation("{client.ClientId} Invalid operation: {io}", client.ClientId, io);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100396 }
397
Jens Geyer2f214c22025-11-13 23:24:45 +0100398 if (Logger.IsEnabled(LogLevel.Information))
399 Logger.LogInformation("{client.ClientId} GetStruct(1)", client.ClientId);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100400
Jens Geyer2f214c22025-11-13 23:24:45 +0100401 var log = await client.getStruct(1, cancellationToken);
402
403 if (Logger.IsEnabled(LogLevel.Information))
404 Logger.LogInformation("{client.ClientId} Check log: {log.Value}", client.ClientId, log.Value);
405
406 if (Logger.IsEnabled(LogLevel.Information))
407 Logger.LogInformation("{client.ClientId} Zip() with delay 100mc on server side", client.ClientId);
408
Jens Geyer2b2ea622021-04-09 22:55:11 +0200409 await client.zip(cancellationToken);
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100410 }
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100411
412
413 private enum Transport
414 {
415 Tcp,
416 NamedPipe,
417 Http,
418 TcpBuffered,
419 Framed,
420 TcpTls
421 }
422
423 private enum Protocol
424 {
425 Binary,
426 Compact,
427 Json,
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100428 }
Kyle Smith7b94dd42019-03-23 17:26:56 +0100429
430 private enum Buffering
431 {
432 None,
433 Buffered,
434 Framed
435 }
Jens Geyeraa0c8b32019-01-28 23:27:45 +0100436 }
437}