Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I would like to know which of WCF or .NET Sockets is the more efficient and the more recommended in a game developpment scenario.

Here are the different parts of the game :

-a client/server communication to play on the internet

-peer to peer on local network.

I would like to know which technology you would use on these parts (wcf on both, socket on both, wcf on one and socket on the other...) and why, if possible.

The game involved doesn't require a high communication frequency (3-4 per second is enough).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
124 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you want to maximize performance sockets is the way to go, WCF has both data and processing overhead. But... if performance is that critical to you, you should also consider assembler instead of c#.

WCF will handle 3-4 requests per second without a blink.

I would start with WCF, it will save you a lot of development time, no need to roll your own parser etc. You can concentrate on other parts on the game instead. If it actually turns our that WCF is too slow for your game you can throw WCF out and go for sockets instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...