Microsoft DirectX 8.1 (Visual Basic)

Using the DirectPlay DPNSVR Application

Microsoft® Windows® allows one process per IP or 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 with 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 notifies DPNSVR on which port it is running. DPNSVR monitors 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.

DPNSVR offers developers the following advantages.

While most applications will benefit from the services of DPNSVR, in some circumstances you may want to disable it. Two examples are:

How to Use DPNSVR

To determine if DPNSVR is supported by your service provider, call the GetSPCaps methods supported by the DirectPlay8Peer, DirectPlay8Client, or DirectPlay8Server objects. If the service provider supports DPNSVR, the DPNSPCAPS_SUPPORTSDPNSRV flag will be set in the dwFlags member or the returned DPN_SP_CAPS type. Only IP and IPX service providers currently support DPNSVR.

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.

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 type. Some additional characteristics of DPNSVR are: