Determine the bandwidth usage of each client on the Streaming Media Server

Source: Internet
Author: User

Determine the bandwidth usage of each client on the Streaming Media Server

Summary

In some cases, it is useful to know the bandwidth used by a single client connected to the server. Sometimes, due to some features (such as Quick Start and quick cache), the bandwidth used may be larger

Capacity transfer rate. This article describes how to add context values so that developers can use these values to retrieve this information programmatically.

To determine the most accurate bandwidth statistics for each client in Windows Media Services 9 series, you must define the following two context values. You must add these values

To the project header file or wmscontextnames. h.

// Type: Long
// Description: bandwidth allocated.
Define_name_and_hint (wms_present_allocated_bandwidth, "wms_present_allocated_bandwidth", 30)

// Type: Long
// Description: bandwidth allocated by network sink.
Define_name_and_hint (wms_present_bandwidth_allocated_by_networksink, "wms_present_bandwidth_allocated_by_networksink", 48)

After adding the demo context value, you can use the demo context of the client to quickly determine the total bandwidth usage by retrieving the two values and then adding them together to get the total value. The following code example shows the operation steps:

// Declare variables.
Long lsinkallocatedbandwidth = 0;
Long ldatapathallocatedbandwidth = 0;
Long ltotalbandwidth = 0;

HR = ppresentationcontext-> getlongvalue (
Wms_present_bandwidth_allocated_by_networksink,
Wms_present_bandwidth_allocated_by_networksink_id,
& Lsinkallocatedbandwidth,
0 );
If (failed (HR ))
{
HR = s_ OK;
Lsinkallocatedbandwidth = 0;
}

HR = ppresentationcontext-> getlongvalue (
Wms_present_allocated_bandwidth,
Wms_present_allocated_bandwidth_id,
& Ldatapathallocatedbandwidth,
0 );
If (failed (HR ))
{
HR = s_ OK;
Ldatapathallocatedbandwidth = 0;
}

Ltotalbandwidth = lsinkallocatedbandwidth + ldatapathallocatedbandwidth;
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.