WSAASyncSelect 足够好吗? 你能建议一个替代方案吗? 印地更好吗?
我从来不喜欢winsock编程的组件,我喜欢它自然的方式,但今天我的同事告诉我在我的项目中使用Indy。你能告诉我Indy是否是我项目的更好选择? -2 个 TCP 服务器,2 个 TCP 客户端。总共 4 个套接字 - 该项目是一个代理。
现在第二个问题,我每天都读到 WSAASyncSelect 不好,这是可以预见的,它来自winsock 1.1。我的问题是:为winsock手工建议比AsyncSelect更好的东西。
谢谢。
I never liked components for winsock programming,I loved it in its natural way,but today my collegue told me to use Indy for my project.Could you tell me if Indy better alternative for my project?
-2 TCP servers,2 TCP clients.4 sockets total
-The project is a proxy.
And now the second question,I read daily that WSAASyncSelect is not good and that's predictable,it's from winsock 1.1.My question is: Suggest something better than AsyncSelect for winsock-by-hand.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的偏好倾向于依靠 synapse 来完成我的所有套接字工作,因为它轻松且易于理解的方法。 它不是一个组件体系结构,而是一个类体系结构,并且实现通常就像复制现有帮助程序类之一并修改它以执行所需的确切步骤一样简单。 Synapse 也有一个很棒的用户社区,并且正在积极开发中,因此可以从 svn 快照中获取最新的更改(我相信它的修订版 98,该网站有一个修订版 38 的 zip)。
My preference tends to lean on synapse for all of my socket work because of its light and easy to understand approach. It is not a component architecture, but a class architecture and implementation is generally as simple as copying one of the existing helper classes and modifying it to perform the exact steps needed. Synapse also has a great user community, and is being actively developed so get the latest changes from the svn snapshot (I believe its revision 98, the website has a zip of revision 38).
是的,Indy 更好,因为它为您提供了 winsock 通信的一致抽象。 区别就像使用 WinApi 创建窗口和仅使用 TForm 创建窗口一样。
Yes, Indy is much better because it provides you with consistent abstraction of winsock communication. The difference is like creation windows using WinApi and simply using TForm.
是的,印地更好。 ICS、Synapse 或任何其他与互联网相关的组件集也是如此。 它们处理所有细节,让您可以处理应用程序的实际功能,而不是将时间浪费在通信层细节上。 它们也比您自己的代码所希望的经过了更好的测试(因为更广泛的用户群以及更广泛的硬件和操作系统)。
如果有结构良好、维护良好且广泛使用的替代方案,特别是当这些替代方案是免费的(如 Indy 和 ICS)时,NIH(不是在这里发明的)是一个非常糟糕的主意。
Yes, Indy is better. So is ICS, or Synapse, or any of the other internet-related component sets. They handle all of the minutia and let you work on your application's actual functionality instead of wasting your time on the communications layer details. They're also much more well tested (because of the broader user base and wider range of hardware and operating systems) than your own code could ever hope to be.
NIH (Not Invented Here) is a really bad idea if there are well-constructed, well-maintained, and widely used alternatives available, especially when those alternatives are free with source (like Indy and ICS).