WinINet vs WinHTTP与TCP / IP [英] WinINet vs WinHTTP vs TCP/IP

查看:176
本文介绍了WinINet vs WinHTTP与TCP / IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的一个申请包括3个部分。 Master,Bridge Server和Slave部分。

Master总是将数据发送到桥接服务器,slave始终从桥接服务器读取数据。

问题在这里:

我希望奴隶,主人和服务器之间传输数据的速度非常快。

哪种方法更好?的WinINet? winHttp或TCP / IP?

奴隶和主人都是dll和服务器如果我可以使用win服务器或者如果使用winINet或winHttp也可以使用linux主机。

所以我想知道速度,安全性超过3种方法。

问候,

Hi,
I one application include 3 parts. Master, Bridge Server and Slave part.
Master always send data to bridge server and slave always read data from bridge server.
Question is here:
I want have very fast speed for transfer data between slave,master & server.
Which method is better? WinINet? winHttp or TCP/IP?
Slave & master both are dll and for server if I can use win server or if use winINet or winHttp can use linux host too.
So I want know about speed, security above 3 methods.
Regards,

推荐答案

为什么不尝试所有这些?我的第一个猜测是它们几乎相同,但微妙的差异(如recv /发送大小,SO_RCVBUF / SO_SNDBUF大小......)有时会产生差异。如果高速是一个问题,那么你应该知道TCP启动缓慢和其他问题(如这个并且还在主题中阅读了wiki,并且一些自定义协议的速度比传统的TCP更高,一个很好的例子是 UDT



所以你需要高速?你认为什么高? 99%的时间TCP就足够了,并且能够很好地完成工作,特别是在高容量传输的情况下,延迟不是问题。另一方面,争夺最后的千字节/秒通常不值得浪费你的时间,并且测量互联网上两个端点之间的最大吞吐量通常是不平凡的。在具有良好且昂贵的交换机的良好本地网络上使用TCP可导致大约100兆字节/秒。出于这个简单的原因,我会花时间使用自定义协议和自定义udp代码,只要它是绝对必要的。



你应该开始尝试替代方案而不是搜索那些给你一把金锤子。尝试一个解决方案(一个具有最简单的实现),如果足够,那么问题就解决了。如果它对你不够好或者你很好奇,那就实施一些其他的比较。
Why don't you try all of them? My first guess would be that they are nearly the same but subtle differences (like recv/send size, SO_RCVBUF/SO_SNDBUF sizes, ...) can make difference sometimes. If high speed is a matter then you should know that TCP has a slow startup and other issues (like this and also read wiki in the topic) and some custom protocols have higher speed then traditional TCP, a good example is UDT.

So you need high speed? What do you consider high? 99% of the time TCP is enough and does the job quite well especially in case of high volume transfer where latency isn't an issue. On the other hand fighting for the last Kilobytes/second usually doesn't worth killing your time and measuring the max throughput between two endpoints on the internet is often nontrivial. Using TCP on a good local network with a good and expensive switch can result in about 100Megabytes/second. For this simple reason I would spend time with custom protocols and custom udp code only if it was absolutely necessary.

You should start trying the alternatives instead of searching for someone who gives you a golden hammer. Try one solution (one that has the simplest implementation) and if its enough then problem solved. If it isn't good enough for you or you are curious then implement some others for comparison.


这篇关于WinINet vs WinHTTP与TCP / IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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