private void EnsureConnection() { if (grpcChannel == null) { const int Port = (int)FpgaGrpc.PortNumbers.VideoProcessorToFpgaPort; grpcChannel = new Channel(this.ServerName + ":" + Port.ToString(), ChannelCredentials.Insecure); grpcClient = new FpgaGrpcChannel.FpgaGrpcChannelClient(grpcChannel); } }
public void Disconnect() { if (grpcChannel != null) { grpcChannel.ShutdownAsync().Wait(); grpcChannel = null; grpcClient = null; } }