Microsoft DirectX 8.1 (Visual Basic) |
By definition, the server application hosts the session. To join a session, a client application must determine the host server's address. A common way to select a host is through a lobby server. In that case, when a user's application is connected to the session, the connection settings that you receive when your DirectPlay8LobbyEvent.Connect method is called include a connection ID and the host's address.
Servers using an IP or IPX service provider can also create a broadcast session, perhaps on a LAN subnet, by advertising themselves as session hosts. To create a broadcast session, call DirectPlay8Server.SetServerInfo to specify the server settings. Then call DirectPlay8Server.Host to advertise the server as a session host. You specify the configuration of the game by assigning values to the DPN_APPLICATION_DESC structure that is passed through the AppDesc parameter of DirectPlay8Server.Host.
To allow your user to look at the available sessions and hosts, a client application can query for available hosts by calling DirectPlay8Client.EnumHosts. Once the user has selected a host, you can request a connection.