The DirectPlaySessionData.SetMaxPlayers method sets the greatest number of players who can join a session.
object.SetMaxPlayers(val As Long)
If the method fails, an error is raised and Err.Number will be set.