?/TD>
Microsoft DirectX 9.0

Using the DirectPlay DPNSVR Application


Microsoft?Windows?allows one process per Internet Protocol (IP) or Internetwork Packet Exchange (IPX) port. Windows does not allow multiple processes to share a single port. To act as a communication host, each application must use a separate port. This restriction creates several issues, especially when doing such tasks as enumerating running games.

The DPNSVR application addresses these issues by acting as a forwarding service for enumeration requests. When an application begins hosting, it informs DPNSVR on which port it is running. DPNSVR listens on a well-known port and forwards any enumeration requests to all Microsoft DirectPlay?hosts on the system. Responses to enumeration requests contain the port number to which the host is actually connected.

The following diagram illustrates how DPNSVR, on a computer with two active host applications, handles an enumeration query from a remote client.

Diagram of how DPNSVR handles an enumeration query

DPNSVR offers developers the following advantages.

While most applications will want to use the services of DPNSVR, there are some circumstances where you may want to disable it. Two examples are:

How to Use DPNSVR

To determine whether DPNSVR is supported by your service provider, call the GetSPCaps methods supported by the IDirectPlay8Peer, IDirectPlay8Client, or IDirectPlay8Server interface. If the service provider supports DPNSVR, the DPNSPCAPS_SUPPORTSDPNSRV flag will be set in the dwFlags member of the returned DPN_SP_CAPS structure. Only IP, IPX, and the network simulator service providers currently support DPNSVR.

Note  If you host a DPNSVR session with the network simulator service provider, you cannot host a DPNSVR session with the 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 IPX session or sessions without DPNSVR.

Using DPNSVR requires no special effort, because it is selected by default. If you do not want enumeration requests forwarded to your host, you must explicitly disable DPNSVR by setting the DPNSESSION_NODPNSVR flag in the dwFlags member of the DPN_APPLICATION_DESC structure. Some additional characteristics of DPNSVR are:

Note  Applications can always enumerate your host if they know the port on which it is running, even if the DPNSESSION_NODPNSVR flag is set.


© 2002 Microsoft Corporation. All rights reserved.