From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../test/Multiplex/Server/Multiplex.Test.Server.cs | 107 +++++++++++++++ .../test/Multiplex/Server/MultiplexServer.csproj | 148 +++++++++++++++++++++ .../Multiplex/Server/Properties/AssemblyInfo.cs | 55 ++++++++ 3 files changed, 310 insertions(+) create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs (limited to 'src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server') diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs new file mode 100644 index 000000000..9786189bb --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System; +using System.Collections.Generic; +using Thrift.Collections; +using Thrift.Transport; +using Thrift.Protocol; +using Thrift.Server; +using Thrift; +using Test.Multiplex; + +namespace Test.Multiplex.Server +{ + public class TestServer + { + class BenchmarkServiceImpl : BenchmarkService.Iface + { + public int fibonacci(sbyte n) + { + int prev, next, result; + prev = 0; + result = 1; + while (n > 0) + { + next = result + prev; + prev = result; + result = next; + --n; + } + return result; + } + } + + class AggrServiceImpl : Aggr.Iface + { + List values = new List(); + + public void addValue(int value) + { + values.Add(value); + } + + public List getValues() + { + return values; + } + } + + static void Execute(int port) + { + try + { + // create protocol factory, default to BinaryProtocol + TProtocolFactory ProtocolFactory = new TBinaryProtocol.Factory(true,true); + TServerTransport servertrans = new TServerSocket(port, 0, false); + TTransportFactory TransportFactory = new TFramedTransport.Factory(); + + BenchmarkService.Iface benchHandler = new BenchmarkServiceImpl(); + TProcessor benchProcessor = new BenchmarkService.Processor(benchHandler); + + Aggr.Iface aggrHandler = new AggrServiceImpl(); + TProcessor aggrProcessor = new Aggr.Processor(aggrHandler); + + TMultiplexedProcessor multiplex = new TMultiplexedProcessor(); + multiplex.RegisterProcessor(Constants.NAME_BENCHMARKSERVICE, benchProcessor); + multiplex.RegisterProcessor(Constants.NAME_AGGR, aggrProcessor); + + TServer ServerEngine = new TSimpleServer(multiplex, servertrans, TransportFactory, ProtocolFactory); + + Console.WriteLine("Starting the server ..."); + ServerEngine.Serve(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + static void Main(string[] args) + { + int port = 9090; + if (args.Length > 0) + { + port = ushort.Parse(args[0]); + } + Execute(port); + } + } +} + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj new file mode 100644 index 000000000..23d325362 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj @@ -0,0 +1,148 @@ + + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {D592BDF3-0DCE-48FB-890F-E4AE1D9CE7CD} + Exe + Properties + MultiplexServer + MultiplexServer + v3.5 + 512 + false + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 0.13.0.0 + false + true + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + Multiplex.Test.Common.cs + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + true + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + {499EB63C-D74C-47E8-AE48-A2FC94538E9D} + Thrift + + + + + + rmdir /s /q "$(ProjectDir)gen-csharp" +del /f /q "$(ProjectDir)ThriftImpl.dll" +SET OUTPUT_DIR=$(ProjectDir) + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\contrib\async-test\aggr.thrift +for %25%25I in ("%25OUTPUT_DIR%25") do set SHORT_DIR=%25%25~fsI +for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI +"$(ProjectDir)\..\..\..\..\..\compiler\cpp\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\lib\rb\benchmark\Benchmark.thrift +for %25%25I in ("%25OUTPUT_DIR%25") do set SHORT_DIR=%25%25~fsI +for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI +"$(ProjectDir)\..\..\..\..\..\compiler\cpp\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + + + + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..2b8a6af23 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MultiplexServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("The Apache Software Foundation")] +[assembly: AssemblyProduct("Thrift")] +[assembly: AssemblyCopyright("The Apache Software Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("F2F436C1-3D4F-411a-ADC3-B98848476A8E")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.13.0.0")] +[assembly: AssemblyFileVersion("0.13.0.0")] -- cgit v1.2.3