IDownload Interface



Summary: All download management can be done from this interface. Use GetDownloadIDs to get a complete list, each download consists of a list of sources that are known to have the file. Multi-source downloading is supported and can be monitored by getting a list of chunks that the file is broken into.


Download Properties:
  GetDownloadIDs
  GetName
  GetStatus
  GetBytesCompleted
  GetFileLength
  GetHash
  GetBytesPerSec
  GetSecETA
  GetSourceCount
  GetSourcePos
  GetActiveSourceCount
  IsCompleted
  IsSearching
  IsRetrying
  GetCoolingCount
  GetReasonClosed
  GetFilePath


Download Methods:
  DownloadFile
  ForceStart
  Stop
  Remove
  RemoveCompleted
  RunFile
  ReSearch
  AddSource
  Proxy


Download Sources: (Download object consists on one or more sources)
  GetSourceIDs
  GetSourceIP
  GetSourcePort
  GetSourceName
  GetSourceSpeed
  GetSourceStatusStr
  GetSourceVendor
  GetSourceHandshake
  GetSourceBytesPerSec


Download Chunks: (Multi-source downloading)
  GetChunkIDs
  GetChunkStart
  GetChunkCompleted
  GetChunkSize
  GetChunkFamily


Download Events: (_IDownloadEvent sink interface)
  OnUpdate


Back to Interface Reference



GetDownloadIDs
  Params: None
  Return: None
  Remarks: Returns array of all downloads


GetName
  Params: Long DownloadID
  Return: String
  Remarks: Returns name of download


GetStatus
  Params: Long DownloadID
  Return: Long (Transfer State)
  Remarks: Returns state of download


GetBytesCompleted
  Params: Long DownloadID
  Return: Long
  Remarks: Returns total bytes completed of download


GetFileLength
  Params: Long DownloadID
  Return: Long
  Remarks: Returns total length of download


GetHash
  Params: Long DownloadID, Long HashID (Hash Type)
  Return: String
  Remarks: Returns Hash of download file


GetBytesPerSec
  Params: Long DownloadID
  Return: Long
  Remarks: Returns speed of download in bytes per sec, averaged over last minute


GetSecETA
  Params: Long DownloadID
  Return: Long
  Remarks: Returns total seconds estimated for download completion


GetSourceCount
  Params: Long DownloadID
  Return: Long
  Remarks: Returns the number of sources that the download knows of for the file


GetSourcePos
  Params: Long DownloadID
  Return: Long
  Remarks: Returns the current position in the list of sources being tried for a connection


GetActiveSourceCount
  Params: Long DownloadID
  Return: Long
  Remarks: Returns the currect number of sources being transferred from


IsCompleted
  Params: Long DownloadID
  Return: Bool
  Remarks: If the download is completed


IsSearching
  Params: Long DownloadID
  Return: Bool
  Remarks: If the download is being re-searched for more hosts


IsRetrying
  Params: Long DownloadID
  Return: Bool
  Remarks: If hosts in the source list are being retried


GetCoolingCount
  Params: Long DownloadID
  Return: Long
  Remarks: Returns number of seconds before sources are retried


GetReasonClosed
  Params: Long DownloadID
  Return: String
  Remarks: Returns a reason of why the download failed


GetFilePath
  Params: Long DownloadID
  Return: String
  Remarks: Returns path on harddrive of file beging downloaded (path will point to partial file while downloading)




DownloadFile
  Params: String FileName, Long FileSize, Long HashID (Hash Type), String Hash
  Return: Long
  Remarks: A direct download from network function, returns DownloadID


ForceStart
  Params: Long DownloadID
  Return: None
  Remarks: Forces a download to start if it is pending or stopped


Stop
  Params: Long DownloadID
  Return: String
  Remarks: Stops a download


Remove
  Params: Long DownloadID
  Return: None
  Remarks: Removes the download, if incomplete partials are deleted


RemoveCompleted
  Params: None
  Return: None
  Remarks: Removes completed downloads from the download list


RunFile
  Params: Long DownloadID
  Return: None
  Remarks: Executes the complete download or partial file


ReSearch
  Params: Long DownloadID
  Return: None
  Remarks: Re-queries the network for more hosts for download


AddSource
  Params: Long DownloadID, Long (Network), String URL
  Return: None
  Remarks: Add source to download, even a web source


Proxy
  Params: Long DownloadID, Bool Enabled, String Default
  Return: None
  Remarks: Use proxy to download file




GetSourceIDs
  Params: Long DownloadID
  Return: Long Array
  Remarks: Returns array of sources for the associated download


GetSourceIP
  Params: Long DownloadID, Long SourceID
  Return: Unsigned Long
  Remarks: Returns IP of source in 4 bytes


GetSourcePort
  Params: Long DownloadID, Long SourceID
  Return: Long
  Remarks: Returns listening port of source


GetSourceName
  Params: Long DownloadID, Long SourceID
  Return: String
  Remarks: Returns the file name on the source


GetSourceSpeed
  Params: Long DownloadID, Long SourceID
  Return: Long
  Remarks: Returns the speed of the source in kilobytes per second


GetSourceStatusStr
  Params: Long DownloadID, Long SourceID
  Return: String
  Remarks: Returns a text status of the source


GetSourceVendor
  Params: Long DownloadID, Long SourceID
  Return: String
  Remarks: Returns the client or 4 character identifier of the source


GetSourceHandshake
  Params: Long DownloadID, Long SourceID
  Return: String
  Remarks: Returns the complete handshake between the client and the source


GetSourceBytesPerSec
  Params: Long DownloadID, Long SourceID
  Return: Long
  Remarks: Returns current download speed from source in bytes per second




GetChunkIDs
  Params: Long DownloadID
  Return: Long Array
  Remarks: Returns array of chunks that download is broken into


GetChunkStart
  Params: Long DownloadID, Long ChunkID
  Return: Long
  Remarks: Returns the start position of the chunk


GetChunkCompleted
  Params: Long DownloadID, Long ChunkID
  Return: Long
  Remarks: Returns the bytes completed of the chunk


GetChunkSize
  Params: Long DownloadID, Long ChunkID
  Return: Long
  Remarks: Returns the total bytes in the chunk


GetChunkFamily
  Params: Long DownloadID, Long ChunkID
  Return: Long
  Remarks: Returns the family the chunk is in (chunks that merge together successfully become part of the same family)




OnUpdate
  Params: Long DownloadID
  Return: None
  Remarks: Signals new download, or a current download's state has changed