wavelength 1.0.0
Loading...
Searching...
No Matches
fileuploadtask.h
Go to the documentation of this file.
1#pragma once
2
3#include <librtmedius.h>
4
5#include "netflow/nettask.h"
6
7class String;
8
16class FileUploadTask : public NetTask {
17public:
27 FileUploadTask(String *pName, char **ppBuffer, int *pnSize)
28 : mName(pName), mBuffer(ppBuffer), mSize(pnSize) {
29 }
30
43 static void OnResponse(int nConnection,
44 int nType,
45 int nSize,
46 const rtMediusFileTransferResponse *pResponse);
47
48protected:
55 void OnStart() override;
56
63 void OnPoll() override;
64
65private:
66 String *mName;
67 char **mBuffer;
68 int *mSize;
69 int mDone;
70 float mPolls;
71 float mRate;
72 float mProgress;
73};
static void OnResponse(int nConnection, int nType, int nSize, const rtMediusFileTransferResponse *pResponse)
Take the progress of a part, and mark the step done after the last part.
void OnPoll() override
Report the estimated progress, and finish once the last part was sent.
void OnStart() override
Send the request.
FileUploadTask(String *pName, char **ppBuffer, int *pnSize)
Construct a step.
Definition fileuploadtask.h:27
NetTask()
Construct a task outside any NetMultiTask.
Definition nettask.h:24
Growable text buffer that is also a PrnStream.
Definition string.h:19