IWMEncStatistics.NetConnectionStats
The NetConnectionStats property retrieves an IWMEncNetConnectionStats object.
Syntax
object = IWMEncStatistics.NetConnectionStats;
Parameters
This property takes no parameters.
Property Value
An IWMEncNetConnectionStats object.
If this property fails, it returns an error number.
Number | Description |
0xC00D1B7D | No statistics are currently available. |
Remarks
This property is read-only. The IWMEncNetConnectionStats interface identifies the number of clients connected to the computer that is hosting the encoding application, and the protocol and IP address of a specific client.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();
// Configure the encoding session including the sources, output,
// and profile, then start encoding.
// You can create a timer control to retrieve the statistics
// (as follows) after you start the encoding session.
// Declare objects and variables.
IWMEncStatistics Stats;
IWMEncNetConnectionStats NetStats;
int lClients;
string sAddr;
int i;
// Retrieve an IWMEncStatistics object and an IWMEncNetConnections
// object.
Stats = Encoder.Statistics;
NetStats = (IWMEncNetConnections)Stats.NetConnectionStats;
// Retrieve the number of clients connected.
lClients = NetStats.ClientCount;
// Retrieve the IP address of each client.
for (i = 0; i < lClients; i++)
{
sAddr = NetStats.get_ClientInfo(i, WMENC_BROADCAST_PROTOCOL.WMENC_PROTOCOL_HTTP);
}
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also