Share via


IWMSCacheProxyServer.DownloadContent (C#)

banner art

Previous Next

IWMSCacheProxyServer.DownloadContent (C#)

The DownloadContent method is called by the cache plug-in to download content to a cache.

Syntax

  

Parameters

bstrOriginUrl

[in] string containing the URL on the origin server identifying the location of the content to download.

bstrCacheUrl

[in] string containing the URL on the cache server identifying the location to which content can be downloaded.

lBandwidth

[in] int containing the maximum bandwidth permitted for downloading. For example, if the bandwidth cannot exceed 300 Kbps, specify 307,200 (300 * 1024). A value of -1 indicates that the bandwidth is unlimited. A value of zero directs that the stream be sent in real time. You can use this parameter to specify a rate other than real time only if the plug-in indicates that the server must use a TCP-based protocol (HTTP or RTSPT) to download content.

lQuotaLow

[in] int containing the low-order bits of a 64-bit unsigned integer that contains the maximum disk space that can be allotted for a download. If the downloaded content would consume more disk space than the maximum permitted, the server stops the download when the maximum is reached.

lQuotaHigh

[in] int containing the high-order bits of a 64-bit unsigned integer that contains the maximum disk space that can be allotted for a download.

lBitFlags

[in] int containing the bit flags. This can be either zero or the following value.

Value Description
WMS_CACHE_CONTENT_DOWNLOAD_ABORT_IF_BCAST The content is a broadcast and cannot be downloaded.

pICacheProxy

[in] IWMSCacheProxy object identifying the plug-in. Event plug-ins can use the pointer to access the cache proxy plug-in when an event occurs.

pIProxyContext

[in] IWMSProxyContext object that enables the server to retrieve client credentials and the name and port number of the proxy server that handles the client request.

pCallback

[in] IWMSCacheProxyServerCallback object containing the callback functions. The server calls IWMSCacheProxyServerCallback.OnDownloadContentProgress and IWMSCacheProxyServerCallback.OnDownloadContentFinished to respond to the plug-in.

varContext

[in] object containing a value defined by the plug-in. For example, your plug-in can use this parameter to persist state information. The server does not alter this value and passes it back when calling IWMSCacheProxyServerCallback.OnDownloadContentProgress or IWMSCacheProxyServerCallback.OnDownloadContentFinished.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x8007000E The server could not allocate memory.

Remarks

It is recommended that cache proxy plug-ins direct the cache manager to use a TCP-based protocol such as HTTP or RTSPT when connecting to the origin server to download content. TCP-based protocols minimize lost packets and enable the plug-in to download content at a rate other than real time. You must specify a value greater than zero in the lBandwidth parameter to download content at a rate other than real time.

It is also recommended that you monitor the download process to determine whether content is actually being downloaded. Some malicious server attacks can make it impossible for the download process to begin. Therefore, if no content is being downloaded after an appropriate amount of time, close the connection.

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next