This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Backend/Services/Server/ServerService.cs
2019-05-31 10:17:14 -04:00

28 lines
862 B
C#

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();
}
}
}