Sign in to follow this  
NEXUSKill

UDP Network in XNA

Recommended Posts

NEXUSKill    475
Just as my other thread this is for an XNA 2d Framework I'm working on, I want to work out a small lightweight library that handles the network threds, packages, connections and so on. My knowledge in networks is limited so I want to clear out some concepts, what exactly is necesary to establish a UDP comunication between two computers using the System.net library (I dont want to use the XNA network because you need to have a live user to make a connection and all that stuff I dont much care for). How do I start a new paralel thread and comunicate between my game and the network thread, how should I handle package loss from the network system point of view (I know that the game should do a lot of sync stuff to compensate, but just what can be done from the connection point of view to "reduce casualtyes"?) Whats the deal with ports? what are sockets? there's so much I know that I don't know!!

Share this post


Link to post
Share on other sites
Imgelling    222
For most of your answers, you can check the forum FAQ.

UDP is connectionless; fire and forget. If it gets there, it gets there; if it don't, it don't. Now, you can wrap code around the UDP to make it behave like there are connections and reliable transports. And instead of writing your own, I think you should go with one already made. I use the old version of it in my game. The new version actually runs in its own thread..

New:
http://code.google.com/p/lidgren-network/

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

FAQ:
http://www.gamedev.net/community/forums/showfaq.asp?forum_id=10

Lidgren + XNA tutorial
http://www.ziggyware.com/readarticle.php?article_id=168

Share this post


Link to post
Share on other sites
NEXUSKill    475
Thanks for the info however, I want to make my own library mostly for educational purposes, in that I mean my own education :P

In my work we use Torque wich has a Server/client architecture and I always screw up something with that, I beleave knowing first hand how a network connection works would gratly help me understand what am I screwing up

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this