IWMSServerLimits.PlayerInactivityTimeout (C#)

banner art

Previous Next

IWMSServerLimits.PlayerInactivityTimeout (C#)

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 = int;
int = IWMSServerLimits.PlayerInactivityTimeout;

Property Value

int containing the permitted connection time in seconds.

If this property fails, it throws an exception.

Number Description
0x80070057 int 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

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











    // Retrieve the IWMSServerLimits object for the server.
    ServerLimits = Server.Limits;

    // Retrieve the maximum amount of time a client
    // can stay idle before being disconnected.
    iValue = ServerLimits.PlayerInactivityTimeout;

    // Set the maximum amount of time a client
    // can stay idle before being disconnected.
    ServerLimits.PlayerInactivityTimeout = 4000;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

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