Ejemplo n.º 1
0
        public static RpcService CreateRpcService(
            string namedPipeName,
            IPipePlatform pipePlatform,
            ISessionFeature session,
            Type rpcService,
            Func <RequestContext, Func <Task>, Task> handler)
        {
            var service = new RpcService(session, rpcService, handler);

            Task.Factory.StartNew(() => service.CreateServer(namedPipeName, pipePlatform),
                                  TaskCreationOptions.LongRunning);

            return(service);
        }
Ejemplo n.º 2
0
        public static RpcService CreateRpcService(
            string namedPipeName,
            IPipePlatform pipePlatform,
            ISessionFeature session,
            Type rpcService,
            Func <RequestContext, Func <Task>, Task> handler)
        {
            var service = new RpcService(session, rpcService, handler);

            _rpcServerThread = new Thread(() => service.CreateServer(namedPipeName, pipePlatform))
            {
                IsBackground = true
            };
            _rpcServerThread.Start();

            return(service);
        }