git-svn-id: svn://db.shs.com.ru/pip@780 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user