WMS MMS Server Control Protocol Plug-in Properties

In Windows Server 2008 operating systems, the MMS protocol is not supported and Windows Media Services does not provide an MMS Server Control Protocol plug-in. Versions of Windows Media Player earlier than 9 Series support only the HTTP and MMS protocols (hey do not support RTSP) If you want a Windows Media running on a Windows Server 2008 operating system to communicate with versions of Windows Media Player earlier than 9 Series, you must configure the server to support HTTP.

A Windows Media server uses the WMS MMS Server Control Protocol plug-in to communicate with clients through the MMS protocol. For administration information about this plug-in, see Windows Media Services Help.

There are two interfaces that you can use to configure the plug-in programmatically. The IWMSBoundIPAddresses interface contains a collection of IP addresses through which the protocol communicates. This interface exposes the following methods.

Method

Description

Add

Adds a new address to the collection.

RemoveAll

Removes all IP addresses from the collection.

The IWMSCPPluginAdmin interface exposes the following properties.

Property

Description

BoundIPAddresses

Retrieves an IWMSBoundIPAddresses object containing a collection of IP addresses that the protocol is bound to.

ControlProtocol

Retrieves the name of the protocol.

ListenAllIPAddresses

Specifies and retrieves a Boolean value indicating whether the server must monitor all IP addresses for incoming client requests.

Port

Specifies and retrieves the port number used by the protocol.

The following examples illustrate how to use the IWMSCPPluginAdmin interface to retrieve a list of the bound IP addresses and specify a port.

Visual Basic .NET Example

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

Private Sub SetMMSCPPluginProps() 

' Declare variables.
Dim Server As WMSServer
Dim Plugin As IWMSPlugin
Dim CPAdmin As IWMSCPPluginAdmin
Dim BoundIPAddr As IWMSBoundIPAddresses

Try
    ' Create a new WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugin object for the
    ' WMS MMS Server Control Protocol plug-in.
    Plugin = Server.ControlProtocols("WMS MMS Server Control Protocol")

    ' Retrieve the administrative interface for the plug-in.
    CPAdmin = Plugin.CustomInterface()

    ' Retrieve the list of bound IP addresses.
    BoundIPAddr = CPAdmin.BoundIPAddresses

    ' Set a Boolean value indicating that the plug-in
    ' will be bound only to specific IP addresses.
    CPAdmin.ListenAllIPAddresses = False

    ' Specify the port to use. Port 1755 is the default port.
    CPAdmin.Port = 1755
Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle exceptions here.
Finally
    ' TODO: Perform clean-up here.
End Try

End Sub 

C# Example

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSCPPluginAdmin CPAdmin;
IWMSBoundIPAddresses BoundIPAddr;

try
{
    // Create a new WMSServer object.
    Server = new WMSServerClass();
    
    // Retrieve the IWMSPlugin object for the
    // WMS MMS Server Control Protocol plug-in.
    Plugin = Server.ControlProtocols["WMS MMS Server Control Protocol"];
    
    // Retrieve the administrative interface for the plug-in.
    CPAdmin = (IWMSCPPluginAdmin)Plugin.CustomInterface;
    
    // Retrieve the list of bound IP addresses.
    BoundIPAddr = CPAdmin.BoundIPAddresses;
    
    // Set a Boolean value indicating that the plug-in
    // will be bound only to specific IP addresses.
    CPAdmin.ListenAllIPAddresses = false;
    
    // Specify the port to use. Port 1755 is the default port.
    CPAdmin.Port = 1755;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception exc)
{
    // TODO: Handle exceptions here.
}
finally
{
    // TODO: Perform clean-up here.
}

C++ Example

#include <windows.h>
#include <atlbase.h>

// To access system plug-in interfaces, the
// type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interface pointers.
IWMSServer*             pServer = NULL;
IWMSPlugins*            pPlugins = NULL;
IWMSPlugin*             pPlugin = NULL;
IDispatch*              pDispatch = NULL;
IWMSCPPluginAdmin*      pCPAdmin = NULL;
IWMSBoundIPAddresses*   pBoundIPAddresses = NULL;
CComVariant             varIndex;
HRESULT                 hr = S_OK;

// 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 an IWMSPlugins interface
// containing the collection of control protocol plug-ins.
hr = pServer->get_ControlProtocols(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface for the
// WMS MMS Server Control Protocol plug-in.
varIndex = "WMS MMS Server Control Protocol";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve an IDispatch pointer to the administration
// interface for the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Call QueryInterface() to retrieve a pointer to the
// IWMSCPPluginAdmin interface.
hr = pDispatch->QueryInterface(IID_IWMSCPPluginAdmin, (void**)&pCPAdmin);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the list of bound IP addresses.
hr = pCPAdmin->get_BoundIPAddresses(&pBoundIPAddresses);
if (FAILED(hr)) goto EXIT;

// Set a Boolean value indicating that the plug-in
// will be bound only to specific IP addresses.
hr = pCPAdmin->put_ListenAllIPAddresses(VARIANT_FALSE);
if (FAILED(hr)) goto EXIT;

// Bind the plug-in to a specific port. Port 1755 is the default.
hr = pCPAdmin->put_Port(1755);
if (FAILED(hr)) goto EXIT;

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

See Also

Reference

IWMSBoundIPAddresses Interface

IWMSBoundIPAddresses Object (C#)

IWMSBoundIPAddresses Object (Visual Basic .NET)

IWMSCPPluginAdmin Interface

IWMSCPPluginAdmin Object (C#)

IWMSCPPluginAdmin Object (Visual Basic .NET)

Concepts

Programming System Plug-in Properties