如何计算通过 Internet 从 Windows Phone 7 传输到 REST WCF 服务的数据大小?
我需要计算使用移动互联网连接传输的数据大小。我很困惑如何做到这一点,有人可以指导我根据我的场景计算大小吗?
我的应用程序正在执行这些功能。
- 以标准格式读取地理位置并将其传递给 wcf 服务。
- 当我们的送货员按下按钮(可能是任何操作)时,我们再次将其传递给 WCF 服务
。简单来说,我们正在使用互联网并使用 WCF 服务。我们的目标是根据消息类型传递最多 500 个字符的字符串。就像如果它是地理位置那么字符串可能是< 30 个字符 如果执行了某些操作(例如按下按钮),则可能是 30 到 500 个字符。
因为我们使用的是 SIM 卡上可用的互联网,并且每月仅允许使用 500 MB,并且我们不想超过此限制。
所以我需要计算一次传输到该网络服务的数据大小。大小以千字节等为单位
谢谢
I need to calculate the size of the data transfered using mobile internet connection. and I am confused how to do it, can somebody please guide me to calculate the size based on my scenarios.
My application is doing these functions.
- Reading geo location in standard formats and passing it to a wcf service.
- When our delivery man is pressing a button (could be any action) then again we are passing it to a wcf service
So in simple words we are using internet and consuming WCF services. We are aiming to pass a string of maximum 500 characters, based on the message type. like if its a geo location then the string could be < 30 characters if some action has been done like a button has been pressed it could be from 30 to 500 characters.
Because we are using internet available on the sim and only 500 mb is allowed per month and we dont want to exceed this limit.
So i need to calculate the size of the data transfered at one time to that webservice. Size interms of kilobytes etc
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多因素可能会影响数据大小。您拥有数据,但还拥有 XML 信封、数据包标头等元数据。还有请求是否被压缩的问题。实际了解其大小的方法是通过常规网络进行调用,并使用 Wireshark 或 Fiddler(取决于您实际测试的位置)之类的工具来查看数据包。然后你就会确切地知道它们有多大。通过一些测试,您可能可以得出合理的算法来根据您的数据估计数据包大小。
There are a lot of things that could affect the data size. You have the data, but you have metadata like the XML envelope, packet headers, etc. There's also the question of whether the requests are compressed. The way to actually know how large it is would be to make the calls over your regular network and use something like Wireshark or Fiddler (depending on where you're actually testing) to look at the data packets. Then you'd know exactly how big they are. With a little testingyou could probably derive a resonable algorithm to estimate packet size based on your data.