DirectPlay Network Communication

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

DirectPlay Network Communication


The primary function of Microsoft® DirectPlay® is to provide you with efficient and flexible messaging support that largely isolates your application from the underlying network hardware and software. If you need to send a status update, you can call the relevant DirectPlay application programming interface (API), regardless of what kind of network link is involved. DirectPlay network service providers support communication over Transmission Control Protocol/Internet Protocol (TCP/IP), Internetwork Packet Exchange (IPX), modem, and serial links.

Notes DirectPlay does not provide secure communications.

DirectPlay Transport Protocol

The core of the DirectPlay networking capabilities is the DirectPlay protocol. This transport-layer protocol has been completely overhauled for DirectPlay 8, and is now used for all messaging. The DirectPlay protocol is focused on making it simple for you to send data from the sending application to the target application, without needing to worry about what happens in between. The protocol offers a number of features that are tailored to the needs of multiplayer games, including:

  • Reliable and unreliable delivery of messages. Reliable messages will be resent until the target application receives them. You can assign the delivery type on a message-by-message basis.
  • Sequential and non-sequential delivery of messages. Sequential messages will be passed to the target application in the order they were sent.
  • Message fragmentation and reassembly. If message size exceeds the capacity of a particular network, DirectPlay automatically fragments and reassembles the message.
  • Congestion control. DirectPlay automatically throttles your outgoing messages to a level that can be handled by the target. This feature prevents you from flooding the target with more messages than it can process.
  • Send prioritization. To ensure that the most important messages get sent first, DirectPlay enables you to designate messages as low, medium, or high priority. The high priority messages are sent to the front of the output queue, followed by medium and low priority messages.
  • Message timeouts. To prevent the outgoing message queue from being clogged with messages that have been superseded by more recent messages, DirectPlay enables you to assign a timeout value to all messages. When a message times out, it is removed from the outgoing message queue, regardless of whether it has been sent or not.

DirectPlay Addresses

In order to deliver messages, each participant in a multiplayer game must have a unique address. Addresses can refer either to the computer that your application is running on (device address), or a computer that your application needs to communicate with (host address).

DirectPlay addresses are in the form of URL strings. These strings consist of a scheme, scheme separator, and data string in the following general format.

x-directplay:/[data string]

The data string contains several elements that specify everything that is needed to enable communication to take place between sender and target, over a variety of different types of network link.

In use, the URL strings are embedded in a DirectPlay address object which is passed to or from DirectPlay API methods. You have the option of either manipulating the URL string directly, or using the methods exposed by the address object to handle each element of the data string separately.


© 2003 Microsoft Corporation. All rights reserved.