Share via


IWMSServerLimits.PlayerInactivityTimeout (Visual Basic .NET)

banner art

Previous Next

IWMSServerLimits.PlayerInactivityTimeout (Visual Basic .NET)

The PlayerInactivityTimeout property specifies and retrieves the maximum length of time that a player is permitted to remain connected without receiving streamed content.

Syntax

  IWMSServerLimits
  .PlayerInactivityTimeout = Integer
Integer = IWMSServerLimits.PlayerInactivityTimeout

Property Value

Integer containing the permitted connection time in seconds.

If this property fails, it returns an error number.

Number Description
0x80070057 Integer is an invalid argument.

Remarks

This property applies only to new connections. Existing connections are controlled by the inactivity time-out specified when they connected. If the parameter is –1, there is no time-out limit. By default, the value of the parameter is 86,400 seconds (24 hours). The value zero is not valid for the return value.

Example Code

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

Private Sub GetSetTimeout()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Limits As IWMSServerLimits
    Dim iValue As Integer

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

    ' Retrieve the IWMSServerLimits object for the server.
    Limits = Server.Limits

    ' Retrieve the maximum amount of time a client
    ' can stay idle before being disconnected.
    iValue = Limits.PlayerInactivityTimeout

    ' Set the maximum amount of time a client
    ' can stay idle before being disconnected.
    Limits.PlayerInactivityTimeout = 4000

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