fileservice::FileTransferManager¶
-
template<typename
TransferEntryClass, typenameSessionClass>
classkanzi::connect::fileservice::FileTransferManager¶ Manages file transfers which can be split into one or more portions to avoid sending large files at once.
- Template Parameters
TransferEntryClass: class which implements the file transfer logic for a single file to one receiverSessionClass: The concrete class which implements the actual output
Public Functions
-
FileTransferManager()¶ ctor Usage of the ctor requires setting the WorkQueueInterface later on before using the class
-
FileTransferManager(WorkQueueInterface *workDispatcher)¶ Constructor.
- Parameters
workDispatcher: The instance which manages the execution of work items in asynchronous manner
-
~FileTransferManager()¶ dtor
Cancel transferring a file to specific receiver.
- Return
True if there was a match and an entry was canceled
- Parameters
uri: Identifies the filesession: Identifies the receiver
Start transferring the given buffer.
- Parameters
uri: The identifier of the file network-widebuffer: The contents to transferhandle: Identifies the transfer between sender and receiversession: Implements the actual outputblockSize: In what size chunks to transfer the buffertimeout_ms: Tell the receiver how long to wait for transfer to finish
-
void
progressFileTransfer(const unsigned int handle)¶ Send the next chunk from the buffer This should be repeatedly called until the transfer has finished.
- Parameters
handle: Identifies the transfer to progress
-
void
setWorkDispatcher(WorkQueueInterface *workDispatcher)¶ Set the work dispatcher.
- Parameters
workDispatcher: The instance which manages the execution of work items in asynchronous manner