IWMSServerLimits.PerPlayerConnectionBandwidth (Visual Basic .NET)

The PerPlayerConnectionBandwidth property specifies and retrieves the maximum bandwidth permitted for a single player connection.

IWMSServerLimits.PerPlayerConnectionBandwidth = IntegerInteger = IWMSServerLimits.PerPlayerConnectionBandwidth

Property Value

Integer containing the maximum bandwidth, in Kbps.

If this property fails, it returns an error number.




Integer is an invalid argument.


This property only applies to new connections. If the parameter is –1, there is no limit on the bandwidth. By default, the value of the parameter is –1.


Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetSetSingleBandwidth()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Limits As IWMSServerLimits
    Dim iValue As Integer

    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSServerLimits object for the server.
    Limits = Server.Limits

    ' Retrieve the bandwidth allowed for each client connection.
    iValue = Limits.PerPlayerConnectionBandwidth

    ' Set the bandwidth allowed for each client connection.
    Limits.PerPlayerConnectionBandwidth = 128

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
    ' TODO: Clean-up code goes here.
End Try

End Sub


Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also


IWMSServerLimits Object (Visual Basic .NET)