Share via


IWMSPublishingPointCurrentCounters Interface

banner art

Previous Next

IWMSPublishingPointCurrentCounters Interface

You can use the IWMSPublishingPointCurrentCounters interface to retrieve real-time information about the number of connections to the publishing point and the amount of bandwidth allocated to the connections.

In addition to the methods inherited from IDispatch, the IWMSPublishingPointCurrentCounters interface exposes the following methods.

Method Description
get_AllCounters Retrieves an array that contains all of the counters supported by the interface.
get_ConnectedPlayers Retrieves the total number of players connected to the publishing point.
get_OutgoingDistributionAllocatedBandwidth Retrieves the bandwidth allocated for distribution connections.
get_OutgoingDistributionConnections Retrieves the total number of distribution connections.
get_PlayerAllocatedBandwidth Retrieves the bandwidth allocated for player connections.
get_StreamingHTTPPlayers Retrieves the total number of players receiving streamed content using the HTTP protocol.
get_StreamingMMSPlayers Retrieves the total number of players receiving streamed content using the MMS protocol. (The MMS protocol is not supported in Windows Server 2008 operating systems.)
get_StreamingPlayers Retrieves the total number of players receiving streamed content from the publishing point.
get_StreamingRTSPPlayers Retrieves the total number of players receiving streamed content using the RTSP protocol.
get_StreamingUDPPlayers Retrieves the total number of players receiving streamed content using the User Datagram Protocol (UDP).

Example Code

The following example illustrates how to retrieve a pointer to an IWMSPublishingPointCurrentCounters interface.

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer                          *pServer;
IWMSPublishingPoints                *pPubPoints;
IWMSPublishingPoint                 *pPubPoint;
IWMSPublishingPointCurrentCounters  *pCurrentCounters;

HRESULT         hr;
CComVariant     varIndex;
long            lCount;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPublishingPoints interface
// and retrieve the total count of publishing points.
hr = pServer->get_PublishingPoints(&pPubPoints);
if (FAILED(hr)) goto EXIT;
hr = pPubPoints->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;
for (long x = 0; x < lCount; x++)
{
    varIndex = x;
    hr = pPubPoints->get_Item(varIndex, &pPubPoint);
    if (FAILED(hr)) goto EXIT;

    // Retrieve a pointer to a list of current statistics
    // for the publishing point.
    hr = pPubPoint->get_CurrentCounters(&pCurrentCounters);
    if (FAILED(hr)) goto EXIT;

    // Release temporary COM objects.
    pPubPoint->Release();
    pCurrentCounters->Release();
}

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Previous Next