public async void LoadMore() { Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("sawContentIds", ""); //param.Add("deviceNum", "a1047301b670fcRWFS407KE0024356"); var top = await RequestsDispatcher.PostResponse <Top>("contents/recommendContents", param); //sawContentIds=27813%2C8666%2C22955%2C26881%2C14083%2C3786%2C27208%2C38161%2C16492%2C12652%2C6968%2C2888%2C8960%2C42573%2C15536%2C41498%2C29807%2C18811%2C39217%2C30438%2C42280%2C198%2C36508%2C32545%2C5162%2C36859%2C14087%2C6229%2C18783%2C29636&deviceNum=3da1047301b670fcRWFS407KE0024356& }
public override Task <CreateClientResponse> CreateClient(CreateClientRequest request, ServerCallContext context) { bool success = RequestsDispatcher.CreateClientProcess(GetClientArguments(request)); if (!success) { throw new RpcException(new Status(StatusCode.Internal, "Couldn't create client process.")); } return(Task.FromResult(new CreateClientResponse())); }
private static void RunMainLoop(ICommandHandler controller, ClientConfiguration clientConfig) { RequestsDispatcher dispatcher = new RequestsDispatcher(clientConfig); Server client = new Server { Services = { ProtoClientConfiguration.BindService( new ConfigurationService(dispatcher)) }, Ports = { new ServerPort( clientConfig.Host, clientConfig.Port, ServerCredentials.Insecure) } }; client.Start(); string rootDirectory = AppDomain.CurrentDomain.BaseDirectory; string scriptsDirectory = rootDirectory + "..\\..\\..\\Scripts\\"; string[] lines = System.IO.File.ReadAllLines(scriptsDirectory + clientConfig.Script); ICommand command; foreach (string line in lines) { if (!TryParse(line, out command)) { Console.WriteLine("Invalid Command"); continue; } command.Accept(controller); } Console.WriteLine("Press any key to stop the client..."); Console.ReadKey(); client.ShutdownAsync().Wait(); }
public ConfigurationService(RequestsDispatcher dispatcher) { requestsDispatcher = dispatcher; }
public async Task LoadAppTop() { var bannerTop = await RequestsDispatcher.GetResponse <List <AppTop> >("banner/apptop?top=5"); var bannerRecommended = await RequestsDispatcher.GetResponse <List <Recommended> >("account/recommend?top=10"); }