Session Management

A DirectPlay session is a communications channel between several computers. Before an application can start communicating with other computers it must be part of a session. An application can do this in one of two ways: it can enumerate all the existing sessions on a network and join one of them, or it can create a new session and wait for other computers to join it. Once the application is part of a session, it can create a player and exchange messages with all the other players in the session.

Each session has one computer that is designated as the host. The host is the owner of the session and is the only computer that can change the session's properties.

The following diagram illustrates the DirectPlay session model.

Session Management Methods

DirectPlay provides several session management methods:

·IDirectPlay3::EnumSessions enumerates all the available sessions.

·IDirectPlay3::Open joins one of the enumerated sessions or creates a new session.

·IDirectPlay3::SecureOpen performs the same function as IDirectPlay3::Open, but enables the application to alter the default opening behavior.

·IDirectPlay3::Close leaves the currently open session.

·IDirectPlay3::GetSessionDesc gets the properties of the current session.

·IDirectPlay3::SetSessionDesc changes the properties of the current session.

·IDirectPlay3::GetCaps gets the communications capabilities of the underlying network.