开发者

Real-time communication with WCF

开发者 https://www.devze.com 2022-12-29 14:39 出处:网络
What\'s the best way to create a real-time communication with wcf? I.e. for games, I need a way that when a remote user press the left arrow ke开发者_StackOverflow社区y on his keyboard, an object in t

What's the best way to create a real-time communication with wcf? I.e. for games, I need a way that when a remote user press the left arrow ke开发者_StackOverflow社区y on his keyboard, an object in the server moves accordingly.

I think I should use WCF, is that the right option?

thanks!


I don't think it's a good idea to use WCF for games programming. The fastest way with WCF would probably be using NET TCP with one-way messages, but you still have quite a bit of overhead.

I'd suggest that you consider programming the sockets directly using UDP or look into a C# lib that does it for you, like lidgren: http://code.google.com/p/lidgren-network

Here are some nice beginner tutorials but they are in C/C++ but they show what you need to consider when you want to write networking code for games: http://www.gamedev.net/reference/list.asp?categoryid=30

Otherwise have a look at how networking is done with XNA. Here is a networking example: http://creators.xna.com/en-us/sample/networkp2p

It really depends on what kind of game you want to use it for. Requirements for a FPS are very different to the requirements for a strategy game.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号