git-svn-id: svn://db.shs.com.ru/pip@780 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-04-18 06:24:26 +00:00
parent b6801457ba
commit 93b62ba1b8
3 changed files with 58 additions and 4 deletions

View File

@@ -35,11 +35,20 @@ public:
//! Contructs packer and try to assign \"dev\"
PIStreamPacker(PIIODevice * dev = 0);
//! Progress info
struct Progress {
Progress();
//! Is send/receive in progress
bool active;
//! Overall send/receive packet size
int bytes_all;
//! Current send/receive size
int bytes_current;
//! Current send/receive progress from 0 to 1
double progress;
};
@@ -57,6 +66,12 @@ public:
ushort packetSign() {return packet_sign;}
bool cryptFragmentationEnabled() const {return crypt_frag;}
void setCryptFragmentationEnabled(bool on) {crypt_frag = on;}
int cryptFragmentationSize() const {return crypt_frag_size;}
void setCryptFragmentationSize(int size_) {crypt_frag_size = size_;}
//! Prepare data for send and raise \a sendRequest() events
void send(const PIByteArray & data);
@@ -69,7 +84,10 @@ public:
//! and \a sendRequest() event to \"dev\" \a PIIODevice::write() handler
void assignDevice(PIIODevice * dev);
//! Returns \a Progress info about sending
Progress progressSend() const;
//! Returns \a Progress info about receiving
Progress progressReceive() const;
EVENT1(packetReceiveEvent, PIByteArray, data)
@@ -104,7 +122,8 @@ protected:
private:
PIByteArray stream, packet;
int packet_size;
bool crypt_frag;
int packet_size, crypt_frag_size;
ushort packet_sign;
int max_packet_size;
Progress prog_s, prog_r;