我想使用远程处理还是仅使用 Socket 连接

发布于 2024-10-19 19:23:34 字数 542 浏览 2 评论 0原文

我正在为一个最初用 VB6 编写的项目编写代码,我和我的合作伙伴正在尝试慢慢地将其迁移到 .NET。同时,我需要一些关于如何执行以下操作的反馈:

我的用户可以运行同一程序的多个实例,以帮助拆分发送到服务器的多个特定消息;如果您一次发送多条消息,服务器将禁止您的 IP。我想做的是共享程序之间发送的这些消息,以便我们可以构建一个分布式消息系统来防止 IP Ban - 这些程序目前运行在同一台机器上。我正在努力尝试,所以我做了几天(不是开玩笑......)天的研究,我得出的结论是我可以在 C# .NET 中编写 DLL ,合并所需的 Interop 来支持 COM,并让 DLL 存储常用的函数、数组等。该函数还会在 VB6 程序上引发事件以发送其消息,然后客户端程序会将这些消息发送到其连接的服务器。

我的合作伙伴说我正在以错误的方式处理这个问题,我应该创建一个服务器应用程序,该应用程序在程序的第一个立场启动时加载,并通过 Socket 在我的客户端之间分发消息。这个过程看起来工作量很大。

我发现这更加困难,因为我在 MSDN 上找到的示例无法编译。如果您知道一个很好的例子,我将非常感谢您发布它。

I'm writing code for a project that was initially written in VB6 and my partner and I are trying to slowly migrate it to .NET. In the mean time I need some feedback on how I should go about doing the following:

My users can run several instances the same program to help split several specific Messages sent to a server; a server that will IP Ban you if you send to many messages at one time. What I want to do is share these messages sent between the programs so that we can build a distributed messaging system to prevent an IP Ban - these programs are running on the same machine at the present. I'm trying to get my feet wet, so I've done several (no joke...) days worth of research and I came to the conclusion that I could write a DLL in C# .NET, incorporate the needed Interop to support COM, and have that DLL store commonly used Functions, Arrays, Etc. The function would also raise events on the VB6 program to send its messages which then the client program would send to the server its connected to.

My partner says I'm going about this the wrong way and that I should to create a Sever application that loads when the first stances of my program starts and distribute messages between my clients via Socket. This process seems like a lot of work.

I'm finding it all the more difficult because samples I've found on MSDN won't compile. If you know of a great example I'd really appreciate you posting it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟雨凡馨 2024-10-26 19:23:34

不要使用远程处理进行新开发。它已被弃用,取而代之的是 WCF。

请改用 WCF。您可以在任何应用程序中托管 WCF 服务,并且它可以使用 TCP/IP 上的二进制文件快速高效地进行通信。

Don't use Remoting for new development. It has been deprecated in favor of WCF.

Use WCF instead. You can host a WCF service in any application, and it can communicate quite quickly and efficiently using binary over TCP/IP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文