FileListTransferCBInterface Class Reference

Used by FileListTransfer plugin as a callback for when we get a file. More...

#include <FileListTransferCBInterface.h>

List of all members.

Public Member Functions

virtual bool OnFile (OnFileStruct *onFileStruct)=0
 Got a file.
virtual void OnFileProgress (OnFileStruct *onFileStruct, unsigned int partCount, unsigned int partTotal, unsigned int dataChunkLength, char *firstDataChunk)
 Got part of a big file internally in RakNet (we cannot access it).
virtual void OnReferencePush (OnFileStruct *onFileStruct, unsigned int partCount, unsigned int partTotal, unsigned int dataChunkLength, char *firstDataChunk)
 Got part of a big file, written to the data block in the plugin (we can access it).
virtual bool Update (void)
 Called while the handler is active by FileListTransfer.
virtual bool OnDownloadComplete (void)
 Called when the download is completed.
virtual void OnDereference (void)
 This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.


Detailed Description

Used by FileListTransfer plugin as a callback for when we get a file.

You get the last file when fileIndex==numberOfFilesInThisSet

See also:
FileListTransfer

Member Function Documentation

virtual void FileListTransferCBInterface::OnDereference ( void   )  [inline, virtual]

This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.

Update will no longer be called. It will will be deleted automatically if true was passed to FileListTransfer::SetupReceive::deleteHandler Otherwise it is up to you to delete it yourself.

virtual bool FileListTransferCBInterface::OnDownloadComplete ( void   )  [inline, virtual]

Called when the download is completed.

If you are finished with this class, return false. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin. Otherwise return true, and Update will continue to be called.

virtual bool FileListTransferCBInterface::OnFile ( OnFileStruct *  onFileStruct  )  [pure virtual]

Got a file.

This structure is only valid for the duration of this function call.

Returns:
Return true to have RakNet delete the memory allocated to hold this file for this function call.

virtual void FileListTransferCBInterface::OnFileProgress ( OnFileStruct *  onFileStruct,
unsigned int  partCount,
unsigned int  partTotal,
unsigned int  dataChunkLength,
char *  firstDataChunk 
) [inline, virtual]

Got part of a big file internally in RakNet (we cannot access it).

You can get these notifications by calling RakPeer::SetSplitMessageProgressInterval Otherwise you will only get complete files.

Parameters:
[in] onFileStruct General information about this file, such as the filename and the first partLength bytes. You do NOT need to save this data yourself. The complete file will arrive normally.
[in] partCount The zero based index into partTotal. The percentage complete done of this file is 100 * (partCount+1)/partTotal
[in] partTotal The total number of parts this file was split into. Each part will be roughly the MTU size, minus the UDP header and RakNet headers
[in] partLength How many bytes long firstDataChunk is
[in] firstDataChunk The first partLength of the final file. If you store identifying information about the file in the first partLength bytes, you can read them while the download is taking place. If this hasn't arrived yet, firstDataChunk will be 0

virtual void FileListTransferCBInterface::OnReferencePush ( OnFileStruct *  onFileStruct,
unsigned int  partCount,
unsigned int  partTotal,
unsigned int  dataChunkLength,
char *  firstDataChunk 
) [inline, virtual]

Got part of a big file, written to the data block in the plugin (we can access it).

Only used for incremental sends. partCount and partTotal are based on how many blocks the file was split into for incremental reads Also only used for UDP. TCP returns the same information, but to OnFileProgress

virtual bool FileListTransferCBInterface::Update ( void   )  [inline, virtual]

Called while the handler is active by FileListTransfer.

Return false when you are done with the class. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin.


The documentation for this class was generated from the following file:

Generated on Mon Dec 7 19:18:31 2009 for RakNet by  doxygen 1.5.7.1