/// <summary> /// Starts the GRPC server. /// </summary> /// <param name="endpoint">The <see cref="IPEndPoint" /></param> /// <param name="srcDeviceId">The <see cref="string" /></param> private void StartGrpcServer(IPEndPoint endpoint, string srcDeviceId) { // GRPC server IServer <Command, FetchRequest, GrpcResponse> communicationServiceGrpc = GRPCServer.Create(endpoint, new ChunkSender(), new ChunkReceiver()); StartServer(srcDeviceId, communicationServiceGrpc); }
private static void Main(string[] args) { RobotConfig config = LoadConfig("./config.json"); GRPCServer server = config.GrpcServer; Channel channel = new Channel(String.Format("{0}:{1}", server.Host, server.Port) , ChannelCredentials.Insecure); var client = new QQBotClient(new ChatBotHub.ChatBotHubClient(channel)); client.ListenTunnel().Wait(); channel.ShutdownAsync().Wait(); Console.WriteLine("Tunnel stopped; program exit."); }