[UWP] App Service适合发送大型阵列? [英] [UWP]App Service suitable for sending large arrays?

查看:78
本文介绍了[UWP] App Service适合发送大型阵列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑为我当前的项目使用应用服务,但我希望应用服务能够快速接收大量数据。

I'm thinking of using app service for my current project, though I would like app service to receive large arrays of data quickly.

应用服务是否可以执行此操作?

Can app service do this?

假设我创建了一个数组:

Lets say I create an array:

int *myArray = new int[1000];
//fill array with data.

// I know this is c# code but yet to translate it to c++.
var message = new ValueSet();
message.Add("Command", "Data");
message.Add("Length", 1000);
message.Add("Data", myArray);
AppServiceResponse response = await this.inventoryService.SendMessageAsync(message);

这么简单吗?

和在接收端:

ValueSet message = args.Request.Message;
string command = (string)message["Command"];
int length = (int)message["Length"];
int *data = (int*)message["Data"];

我需要知道是否可以快速发送大数据?如果情况并非如此,那么我的当前项目就没有意义了。

I need to know if it is possible to send large data quickly? If it's not the case then theres no point continuing with my current project.

谢谢。

Thanks.

推荐答案

对ValueSet进行了一些研究:

Done a little bit of research on ValueSet:

public ref class DataClass sealed { ...

int * data;
}

int *data; }

然后将其添加到ValueSet对象:

Then add it to the ValueSet object:

ValueSet set = new ValueSet(); DataClass *tc = new DataClass();

tc-> data = new int [1000];

tc->data = new int[1000];

//填充数据数组

set.Add(" Data" ,tc);

set.Add("Data", tc);

像这样的东西能用app服务来发送大数组数据吗?

Will something like this work with app service to send large array data?

谢谢。

这篇关于[UWP] App Service适合发送大型阵列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆