2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 14:38:43 +00:00
Files
esiur-dotnet/Tests/RPC/Thrift/Program.cs
T
2026-06-08 16:15:57 +03:00

17 lines
599 B
C#

using Thrift.Server;
using Thrift.Protocol;
using Thrift.Transport.Server;
using Esiur.Tests.RPC.ThriftServer;
var handler = new EchoHandler();
var processor = new Echo.ThriftModel.EchoService.AsyncProcessor(handler);
var port = 5400;
var serverTransport = new TServerSocketTransport(port, new Thrift.TConfiguration());
var server = new TSimpleAsyncServer(processor, serverTransport, new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(),
LoggingHelper.LogFactory);
Console.WriteLine($"Thrift server listening on port {port}...");
await server.ServeAsync(new CancellationToken());