?/TD>
Microsoft DirectX 9.0

Peer-to-Peer Host Messages


This document describes how to handle Microsoft?DirectPlay?messaging for the host of a peer-to-peer session. It discusses only those messages that are specific to a host. For a discussion of messaging for a normal peer, see Handling Standard Peer-to-Peer Messages. For a discussion of general messaging issues, see Handling DirectPlay Messaging.

Starting a Session

You can set up a peer-to-peer session in two ways:

In either case, you must start the session by calling IDirectPlay8Peer::Host. Once you start the session, you must be prepared to handle the following messages:

Host Migration and Session Termination

Every peer-to-peer session must have a host. However, the original host may leave the session either by calling IDirectPlay8Peer::Close or by being disconnected. This situation can be handled in one of two ways:

The original host specifies which of those two options is to be followed when it calls IDirectPlay8Peer::Host to start the session. If it enables "host migration" by setting the DPNSESSION_MIGRATE_HOST flag in the DPN_APPLICATION_DESC structure, a new host will be chosen when the current host leaves. However, even if host migration is enabled, the host can force the session to terminate by calling IDirectPlay8Peer::TerminateSession. If host migration is not enabled, the session terminates when the host leaves. The host will then receive the same messages as all other members of the session. See Handling Standard Peer-to-Peer Messages for details.



© 2002 Microsoft Corporation. All rights reserved.