XNA for C#
DirectX 9 for C#
DirectX 9 for C++
DirectX 9 for VB
My XNA Book
       Go to section on this site

Additional info

Latest Forum posts

 Account settings
  Posted by: Anonymous
  When: 07/05/2014 at 09:48:39

 forced subtitle
  Posted by: Applefly
  When: 07/05/2014 at 06:00:48

 convert DVD into PMS
  Posted by: Applefly
  When: 07/05/2014 at 05:55:25

 DVD to Digital Copy easily
  Posted by: VIKIVannessa
  When: 05/05/2014 at 06:52:29

 DVD on Xbox 360/Xbox One Console
  Posted by: VIKIVannessa
  When: 05/05/2014 at 06:51:47

 Extract .Srt Subtitles
  Posted by: Applefly
  When: 04/05/2014 at 03:54:38

 Encode Movie collection
  Posted by: Applefly
  When: 04/05/2014 at 03:52:41

 Convert DVD to WMV
  Posted by: Applefly
  When: 29/04/2014 at 05:53:50

 rip DVDs into digital files
  Posted by: Applefly
  When: 29/04/2014 at 05:51:20

 iTunes movies/music to Kindle Fire
  Posted by: ciciyu80
  When: 29/04/2014 at 05:10:20


XNA 3.0 Game Programming Recipes

Riemer Grootjans

Chapter 8: Networking in XNA 3.0 (28 pages)

The XNA 3.0 Framework contains networking capabilities, allowing you to play your game on multiple PCs and Xbox 360 consoles. Once again, the XNA team has made sure the same code can be used to connect a PC or an Xbox 360 console to a session over the network.

This chapter shows and explains how you can set up a networking session and how you can connect to an existing session. Next, you will learn how you can send and receive data to/from other players over the network. You’ll also learn how you can use the lobby functionality that comes with XNA.

8-1. Sign In for Networking Services
Before you can use any of XNA’s networking functionality, you need to sign in to the Gamer Services. This recipe shows you how easy this is.

8-2. Create a Network Session
The first step in connecting multiple computers over the network, is to set up a Network session.

8-3. Join a Networking Session
Once a Network Session has been created, other computers on the networks can join the Session. This recipe also shows how your program can stay informed about changes in the Sessions, such as players joining or leaving the session.

8-4. Send/Receive Data Over the Network
A Network Session is only useful if you can send over some data to other computers. This recipe shows you how this can be done.

8-5. Search for Networking Sessions Asynchronously
Since some networking operations, such as searching for active Network sessions, can take some time to complete, XNA also provides some Asynchronous network methods. These allow your program to continue while XNA is completing the network method in the background, allowing you to keep the use informed about any progress made so far.

8-6. Add Rich Presence Information
New to XNA 3.0, you now can add Rich Presence information to each of your players, which informs outside viewers from their current status in your game.

8-7. Move from the Lobby to the Actual Game
XNA comes with basic built-in lobby signalling, allowing you to wait for all players to have toggled their Ready flag before starting the game.

Recipe 8-5: A new network session is created after no active session could be found on the network. A few players connect to the session and transmit data.


If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !

- Website design & XNA + DirectX code : Riemer Grootjans -
©2003 - 2011 Riemer Grootjans

This site in English
This site in Korean
This site in Czech

Microsoft MVP Award

2007 - 2011 MVP Award
DirectX - XNA


XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
-- Expand all --

Thank you!

Support this site --
any amount is welcome !

Stay up-to-date

I don't have the time to keep a News section, so stay informed about the updates by clicking on this RSS file!