Protobufs compile

This commit is contained in:
watsonb8
2019-05-31 10:17:14 -04:00
parent 9354c0b27b
commit 6503d2c410
9 changed files with 228 additions and 42 deletions

View File

@ -0,0 +1,10 @@
using System;
using Aurora.Backend.Proto;
namespace Aurora.Backend.Services.Server
{
class PartyServiceImpl : PartyService.PartyServiceBase
{
}
}

View File

@ -0,0 +1,10 @@
using System;
using Aurora.Backend.Proto;
namespace Aurora.Backend.Services.Server
{
class PlaybackServiceImpl : PlaybackService.PlaybackServiceBase
{
}
}

View File

@ -0,0 +1,28 @@
using System;
using Grpc.Core;
using Aurora.Backend.Proto;
namespace Aurora.Backend.Services.Server
{
public class ServerService : BaseService<ServerService>
{
const int Port = 50051;
public ServerService()
{
Grpc.Core.Server server = new Grpc.Core.Server
{
Services = {
PartyService.BindService(new PartyServiceImpl()),
PlaybackService.BindService(new PlaybackServiceImpl()) },
Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) }
};
server.Start();
Console.WriteLine("Aurora server listening on port " + Port);
Console.WriteLine("Press any key to stop the server...");
Console.ReadKey();
server.ShutdownAsync().Wait();
}
}
}