VB.Net - 客户端/服务器游戏的网络方法

发布于 2024-08-01 21:06:57 字数 862 浏览 9 评论 0原文

我的第一个问题就简单点吧:)

我已经开发了很多年,并且使用 Web 服务编写了太多应用程序(主要是 Web 应用程序) - 我对 SOAP/WSDL/等感到满意...我也曾经以前使用旧的winsock 编写TCP/IP 客户端-服务器应用程序。

我有点无聊,正在寻找一个新项目来扩展我的技能,因此决定尝试做一个游戏或某种服务器监控和远程控制应用程序,

我还没有决定哪个以及这个问题的答案希望能告知我的决定。

我想要一些关于我应该寻找哪些方法来处理通信的建议。

假设我现在正在玩这个游戏 - 我想要低延迟的双向通信,并且能够处理尽可能多的同时连接。

我考虑过 Web 服务,但它似乎需要很大的开销 - 特别是当我需要客户端也公开一个服务时。

TCP/IP 可以完成这项工作,但看起来有点低级,而且我也有很多优点,比如定义。 想必我需要为通信等制定一种新协议...我也不确定如何让一个客户端使用多个通道来获取并发信息 - 例如聊天和更新位置信息。 我可以尝试以某种方式对其进行多路复用,但我最初的想法是:排队看起来相当混乱

。Net 远程处理 - 我根本没有真正接触过这么多。 似乎比网络服务开销更低、灵活性更高,但我还不够了解,无法正确评估。

我真的很感激您可以提供的任何意见(并且教程的链接会很棒)

提前感谢您的帮助

编辑:我有一个答案,它指向我一个 UDP 库。 UDP 适合这个吗? 对于不需要历史记录的位置信息/类似信息,我可以看到这有什么好处,但对于聊天来说,丢失的数据包可能是一个问题 - 或者我是否手动发回收据确认? 如果是这样,我是否会为了有限的优势而重复 TCP/IP 功能?

如果这是扩展问题的不正确方式,我们深表歉意 - 对此的指导也表示赞赏:)

My first question so go easy on me :)

I've been developing for years and have written WAY too many apps (mostly web apps) using web services - I'm happy with SOAP/WSDL/etc... I also used to write TCP/IP client-server apps back in the day using good old winsock.

I'm a bit bored and looking for a new project to expand my skills so decided to have a go at doing either a game or some sort of server monitoring and remote control application

I haven't decided which and the answer to this question will hopefully inform my decision.

What I'd like is some advice as to which methods I should be looking to handle the communication.

Let's assume I'm doing thew game for the moment - I want 2-way communication with low latency and the ability to handle as many simultaneous connections as possible.

I've considered web services but it seems like a lot of overhead - especially as I'd need the client to expose one as well.

TCP/IP would do the job but seems like it's a little low-level and I lsoe a lot of the advantages like definitions. Presumably I'd need to formulate a new protocol for the communications etc... I'm also unsure how I'd have one client use multiple channels for concurrent information - eg a chat and updating location information. I could attempt to multiplex this in some way but my initial ideas re: the queuing seem quite messy

.Net remoting - I've not really touched this much at all. Seems to have low overhead and more flexibility than webservices but I don't know enough to evaluate properly.

I'd really appreciate any input you can provide (and a link to a tutorial would be fantastic)

Thanks in advance for your help

EDIT: I've had an answer which points me at a UDP library. Is UDP appropriate for this? For location information/similar which requires no history, I can see how this is advantageous but for a chat, a lost packet could be an issue - or do I manually send back an acknowledgment of receipt? If so, aren't I duplicating TCP/IP functionality for limited advantage?

Apologies if this is an incorrect way to expand on the question - guidance for that appreciated too :)

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

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

发布评论

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

评论(2

撑一把青伞 2024-08-08 21:06:57

如果您是最新的 .NET 3.5 SP1,那么您应该使用 WCF。 您说您不想使用 Web 服务,我认为您的意思是您不想使用 SOAP over HTTP。 WCF 比 SOAP over HTTP 做的事情要多得多。 特别是,它可以使用相同的基础设施通过 TCP/IP 执行二进制操作。 它还支持点对点。

If you're up to date on .NET 3.5 SP1, then you should use WCF. You say you don't want to use web services, and I assume from that you mean you don't want to use SOAP over HTTP. WCF does a lot more than SOAP over HTTP. In particular, it can do binary over TCP/IP using the same infrastructure. It also has support for peer-to-peer.

浅忆流年 2024-08-08 21:06:57

看看 Lidgren 之类的东西,看看它是如何工作的。 它是用 C# 编写的,因此可以与 VB.Net 一起使用

Lidgren 是一个套接字包装器,我在一些小型多人游戏中使用过它(主要是通过使用标头说明数据包类型。即第一个字节表示数据包类型,

Lidgren

Take a look at something like Lidgren and see how that work's. Its written in c# so its able to be used with VB.Net

Lidgren is a socket wrapper, Ive used it in a few small scale multiplayer games, ( mainly by using a header stating packet type. ie first byte represents packet type,

Lidgren

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