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