Share via


IWMSPublishingPointLimits.PerPlayerConnectionBandwidth (C#)

banner art

Previous Next

IWMSPublishingPointLimits.PerPlayerConnectionBandwidth (C#)

The PerPlayerConnectionBandwidth property specifies and retrieves the maximum bandwidth, in Kbps, permitted for a player connection on the publishing point.

Syntax

  IWMSPublishingPointLimits
  .PerPlayerConnectionBandwidth = int;
int = IWMSPublishingPointLimits.PerPlayerConnectionBandwidth;

Property Value

int containing the maximum bandwidth, in Kbps, permitted per player.

If this property fails, it throws an exception.

Number Description
0x80070057 int is an invalid argument.

Remarks

This limit applies only to new connections. It is also used to determine the bandwidth limit for a multicast stream.

By default, the parameter is –1, indicating that there is no limit on the maximum bandwidth permitted. Valid values are –1 to 2147483647.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer                   Server;
IWMSPublishingPoints        PubPoints;
IWMSPublishingPoint         PubPoint;
IWMSPublishingPointLimits   Limits;

int                        iValue;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve information about each publishing point.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        // Retrieve the IWMSPublishingPointLimits
        // object for the publishing point.
        Limits = PubPoint.Limits;

        // Retrieve the bandwidth limit allowed for each
        // client connection.
        iValue = Limits.PerPlayerConnectionBandwidth;
        
        // Set the bandwidth limit allowed for each client connection.
        Limits.PerPlayerConnectionBandwidth = 128;
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

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

Previous Next