Jump to content
  • Advertisement
Sign in to follow this  
Toolmaker

[.net] .NET network library?

This topic is 3966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently in the process of looking into a network library for my C# game. My initial thought was using RakNet, but after I checked, there is no official RakNet .NET binding. I'm looking for a network library that supports both TCP and UDP. For UDP is must ensure that my data WILL arrive, and that it will arrive in order. It's pretty important that the data is ensured to be delivered. I did some googling, but there's a massive amount of libraries, so it's pretty difficult to narrow down which ones are good, and which ones provide a good API. Toolmaker

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Toolmaker
I'm currently in the process of looking into a network library for my C# game. My initial thought was using RakNet, but after I checked, there is no official RakNet .NET binding.

I'm looking for a network library that supports both TCP and UDP. For UDP is must ensure that my data WILL arrive, and that it will arrive in order. It's pretty important that the data is ensured to be delivered.

I did some googling, but there's a massive amount of libraries, so it's pretty difficult to narrow down which ones are good, and which ones provide a good API.

Toolmaker

UDP with garaunteed, ordered arrival of packets is exactly TCP. TCP is built on top of UDP for the very reason to provide it with garaunteed, ordered arrival of packets.

Check out the System.Net and System.Net.Sockets namespaces. They are very featureful. They are not just a simple wrapper of WinSock.

Share this post


Link to post
Share on other sites
I want UDP because it's connectionless. When the host is being dropped, it's much easier to maintain connections to the other clients. I'm making an RTS, so having connectionless connections is an added pro. UDP also has the added goodness that the opened tunnel stays open for a while in a NAT environment. Players don't have to open ports to play the game, except the player that hosts the initial connection.

However, during my research on RTS games in a networked environment, I ran into the "1500 archers over 28.8K" article on Gamasutra. One of the things they mentioned was UDP and garantueed delivery. However, it might be a good idea to drop the demand for delivery in order of sending. But, I want garantueed delivery.

Toolmaker

Share this post


Link to post
Share on other sites
[opinion]
If you care about guaranteeing order and delivery then there is no reason not to go with TCP. Anything you code for UDP that does that will be slower then just using TCP in the first place. That is not a slam against you, I don't know of anyone that could do it. If you really do care about that, then just use the "correct" protocol for what you are trying to do.

For the NAT issue, just look up "TCP" and "NAT punch through". It is pretty easy.

[/opinion]

Good luck with your project.
theTroll

Share this post


Link to post
Share on other sites
The problem with TCP is that you cant have non-garanteed packets. Thats why there are libraries for garanteed UDP packets.

Look here:
http://code.google.com/p/lidgren-library-network/

I havent used this library yet, but it looks very good.

Share this post


Link to post
Share on other sites
Quote:
Original post by Toolmaker
I'm looking for a network library that supports both TCP and UDP. For UDP is must ensure that my data WILL arrive, and that it will arrive in order. It's pretty important that the data is ensured to be delivered.


If you read the OP, he wants guaranteed delivery. So why use UDP?

theTroll

Share this post


Link to post
Share on other sites
Quote:
Original post by Toolmaker
I want UDP because it's connectionless.


If you read the OP, he wants UDP. So why use TCP?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!