Manages file transfers which can be split into one or more portions to avoid sending large files at once.
More...
#include <file_transfer_manager.hpp>
template<typename TransferEntryClass, typename SessionClass>
class kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >
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 receiver |
SessionClass | The concrete class which implements the actual output |
◆ FileTransferManager() [1/2]
template<typename TransferEntryClass , typename SessionClass >
ctor Usage of the ctor requires setting the WorkQueueInterface later on before using the class
◆ FileTransferManager() [2/2]
template<typename TransferEntryClass , typename SessionClass >
Constructor.
- Parameters
-
workDispatcher | The instance which manages the execution of work items in asynchronous manner |
◆ ~FileTransferManager()
template<typename TransferEntryClass , typename SessionClass >
◆ cancelTransfer()
template<typename TransferEntryClass , typename SessionClass>
Cancel transferring a file to specific receiver.
- Parameters
-
uri | Identifies the file |
session | Identifies the receiver |
- Returns
- True if there was a match and an entry was canceled
◆ initiateTransfer()
template<typename TransferEntryClass , typename SessionClass>
void kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::initiateTransfer |
( |
const string & |
uri, |
|
|
vector< char > & |
buffer, |
|
|
unsigned int |
handle, |
|
|
shared_ptr< SessionClass > |
session, |
|
|
unsigned int |
blockSize, |
|
|
unsigned int |
timeout_ms |
|
) |
| |
|
inline |
Start transferring the given buffer.
- Parameters
-
uri | The identifier of the file network-wide |
buffer | The contents to transfer |
handle | Identifies the transfer between sender and receiver |
session | Implements the actual output |
blockSize | In what size chunks to transfer the buffer |
timeout_ms | Tell the receiver how long to wait for transfer to finish |
◆ progressFileTransfer()
template<typename TransferEntryClass , typename SessionClass >
Send the next chunk from the buffer This should be repeatedly called until the transfer has finished.
- Parameters
-
handle | Identifies the transfer to progress |
◆ setWorkDispatcher()
template<typename TransferEntryClass , typename SessionClass >
Set the work dispatcher.
- Parameters
-
workDispatcher | The instance which manages the execution of work items in asynchronous manner |
The documentation for this class was generated from the following file:
- virtualfile_service/file_transfer_manager.hpp