Microsoft DirectX 9.0 SDK Update (Summer 2003)

Testing Network Performance


Microsoft® DirectPlay® offers the DP8Sim service provider that allows you to test your DirectPlay application in a variety of network conditions, such as high latency and packet loss. The network simulator is not a replacement for testing in the real deployment environment, but it can help you predict how your application will perform.

DirectPlay also offers the DP8Sim Utility if you don't want to create your own testing environment. The main advantage of using the IDP8SimControl interface and the DP8Sim service provider in your application is that it allows you to integrate the network settings into your application's debugging user interface (UI), command line, or scripting tools instead of having to manually change the settings through the DP8Sim Utility.

Note  The network simulator is implemented on top of the existing DirectPlay8 TCP/IP Service Provider. The settings are also applied on top of the existing network characteristics. Therefore, it is intended to be used on a high-speed local area network (LAN) where normal latency and packet loss are negligible.

Using the DP8Sim service provider

You can switch between the standard Transmission Control Protocol/Internet Protocol (TCP/IP) service provider to the DP8Sim service provider to run network simulation tests on your application. To set the network simulator as your service provider, you have three choices.

Note  The DP8Sim service providers enumerated will have the DPNSPINFO_NETWORKSIMULATORDEVICE flag set in the dwFlags member of the DPN_SERVICE_PROVIDER_INFO structure.

The following example shows how to explicitly set the service provider to the network simulator.

IDirectPlay8Address*  g_pDeviceAddress;
.
.
.
hr = CoCreateInstance( CLSID_DirectPlay8Address, NULL,	
                       CLSCTX_INPROC_SERVER,
                       IID_IDirectPlay8Address,
                       (LPVOID*) &g_pDeviceAddress );

hr = g_pDeviceAddress->SetSP(&CLSID_NETWORKSIMULATOR_DP8SP_TCPIP );

When using the DP8Sim service provider, DirectPlay will set the DPNSPCAPS_NETWORKSIMULATOR in DPN_SP_CAPS.

Note  If you host a DPNSVR session with the network simulator service provider, you cannot host a DPNSVR session with the Internet Protocol (IP) service provider, and vice versa. All DPNSVR sessions must be with either the IP or the network simulator service provider. This does not affect your ability to host an Internetwork Packet Exchange (IPX) session or sessions without DPNSVR.


© 2003 Microsoft Corporation. All rights reserved.