Sending and Recieving Data over the Internet  
Author Message
MegaMasterX





PostPosted: .NET Framework Networking and Communication, Sending and Recieving Data over the Internet Top

Hello, I'm trying to code an Online game and I'm stumped as to how to make the Client software communicate with the server software I made. I know that I should use the Net.WebClient for something...Please give me some help, With this I can launch the beta of my MMORPG!

Basically I want to constantly transfer 16 variables containing Player data over an internet connection. I want the server software to be able to manage and distribute player data to all online clients. For example: Seeing another player move close to you and chat.

Thanks In Advance!



.NET Development5  
 
 
rkimble





PostPosted: .NET Framework Networking and Communication, Sending and Recieving Data over the Internet Top

You probably want to use the System.Net.Sockets.TCPClient or UDPClient objects. You'll pick a port, or range of ports (search for assigned ports and pick from the unassigned range) and send your data directly as an array of bytes (this can easily be an entire class serialized into bytes or xml).

UDP can work great because you don't have to worry about maintaining connections and its designed for just shooting information without worrying about its arrival. A simple acknowledgement system lets you ensure you've got the current data.