IWMSCPPluginAdmin.Port (Visual Basic .NET)

banner art

Previous Next

IWMSCPPluginAdmin.Port (Visual Basic .NET)

The Port property specifies and retrieves the port number used by the protocol.

Syntax

  IWMSCPPluginAdmin
  .Port = Integer
Integer = IWMSCPPluginAdmin.Port

Property Value

Integer containing the port number.

Remarks

If you are behind a firewall, you must explicitly open an appropriate port for each protocol you want to use. The following table identifies the incoming ports you must open for each protocol.

  • Note   Windows Media Player 9 Series and later does not use the MMS protocol.
  • The MMS protocol is not supported in Windows Server 2008 operating systems.
Protocol Port
MMST TCP port 1755
MMSU UDP port 1755
RTSPT TCP port 554
RTSPU UDP port 5005
HTTP TCP port 80

You must also open the outgoing UDP ports 1024-5000 to send data to Windows Media Player and other clients.

Example Code

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

Private Sub SetPort()

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

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the plug-in to be configured.
    Plugin = Server.ControlProtocols.Item("WMS RTSP Server Control Protocol")

    ' Retrieve the custom interface of the plug-in.
    CPAdmin = Plugin.CustomInterface

    ' Bind the plug-in to a specific port.
    CPAdmin.Port = 31667

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

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