Chapter 19. Creating a ClientServer Session

Chapter 19. Creating a Client/Server Session

IN THIS CHAPTER

  • Creating a Dedicated Server Session

  • Connecting a Client

  • Detecting Users Joining and Leaving Your Session

  • Sending Data Packets

  • Making the Client React

  • Handling the Server Lost Event

  • In Brief

Peer-to-peer sessions can work quite well when you're dealing with a small subset of users. However, when you're looking to maintain a network session with hundreds or even thousands of simultaneous players, you really need a dedicated server. In a peer-to-peer session, all data sent from one peer to the other peers can be duplicated for every peer in the session. For small groups, this isn't prohibitive, but even a small chunk of data can be quite large when it's sent 10,000 times.

DirectPlay includes two other networking classes much like the peer object: the client and the server objects. You can think of each of these as a subset of the functionality that exists in the peer object, considering that the peer object is essentially both a client and a server. In this chapter you will create a client/server application that delves a little deeper into the workings of DirectPlay, including

  • Creating dedicated servers running on particular ports

  • Connecting to these servers using the client interface

  • Tracking player joining and disconnecting

  • Sending game-specific data



Managed DirectX 9 Graphics and Game Programming, Kick Start
Managed DirectX 9 Kick Start: Graphics and Game Programming
ISBN: B003D7JUW6
EAN: N/A
Year: 2002
Pages: 180
Authors: Tom Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net