示例#1
0
        /// <summary>
        /// A gRPC server specialized for AI Video inter-process communication
        /// </summary>
        /// <param name="callback">The callback function is called asynchronously, so it may be synchronous</param>
        public GrpcServer(string hostName, Func <ImageRequest, ImageReply> callback)
        {
            const int Port = (int)CameraServer.PortNumbers.CameraServerPort;

            this.Ports.Add(new ServerPort(hostName, Port, ServerCredentials.Insecure));
            this.Services.Add(GrpcChannel.BindService(new GrpcListener(callback)));
        }
        /// <summary>
        /// A gRPC server specialized for AI Video inter-process communication
        /// </summary>
        /// <param name="callback">The callback function runs asynchronously, so it may be synchronous</param>
        public GrpcServer(string hostName, Action <ImageBody> callback)
        {
            const int Port = (int)VideoProcessorGrpc.PortNumbers.CameraToVideoProcessorPort;

            HostAddress = IpHelper.Get172SubnetIpV4(hostName);
            this.Ports.Add(new ServerPort(HostAddress, Port, ServerCredentials.Insecure));
            this.Services.Add(GrpcChannel.BindService(new GrpcListener(callback)));
        }