The DirectPlay API is a network abstraction and distributed object system that applications can be written to. The API defines the functionality of the abstract DirectPlay network and all the functionality is available to your application regardless of whether the actual underlying network supports it or not. In cases where the underlying network does not support a method, DirectPlay contains all the code necessary to emulate it. Examples include group messaging and guaranteed messaging.
DirectPlay's service provider architecture insulates the application from the underlying network it is running on. The application can query DirectPlay for specific capabilities of the underlying network, such as latency and bandwidth, and adjust its communications accordingly.
The following diagram illustrates the DirectPlay service provider architecture.
The first step in using DirectPlay is to select which service provider to use. The service provider determines what type of network or protocol will be used for communications. The protocol can range from TCP/IP over the Internet to an IPX local area network to a serial cable connection between two computers.
Use the service provider to make a connection to a point on the network. The user may need to provide additional information to make a connection, or the application can specify the connection parameters.
Connection Management Methods
DirectPlay provides two very useful connection management methods:
·IDirectPlay3::EnumConnections enumerates all the connections that are available to the application.
·IDirectPlay3::InitializeConnection initializes a specific connection.