PIObject::deleted now has 1 argument
PIIODevice small refactoring new PIIODevice virtual methods: threadedReadTerminated() and threadedWriteTerminated() PIIODevice::stop now accept bool "hard" instead of "wait" PIStreamPacker new features: packet size crypt and aggressive optimization
This commit is contained in:
@@ -57,26 +57,38 @@ public:
|
||||
void setMaxPacketSize(int max_size) {max_packet_size = max_size;}
|
||||
|
||||
//! Returns maximum size of single packet, default 1400 bytes
|
||||
int maxPacketSize() {return max_packet_size;}
|
||||
int maxPacketSize() const {return max_packet_size;}
|
||||
|
||||
|
||||
//! Set packet sinature
|
||||
void setPacketSign(ushort sign_) {packet_sign = sign_;}
|
||||
|
||||
//! Returns packet sinature, default 0xAFBE
|
||||
ushort packetSign() {return packet_sign;}
|
||||
ushort packetSign() const {return packet_sign;}
|
||||
|
||||
|
||||
//! Set receive aggressive optimization. If yes then %PIStreamPacker doesn`t
|
||||
//! check every byte in incoming stream but check only begin of each read()
|
||||
//! result. Default is \b true.
|
||||
void setaAggressiveOptimization(bool yes) {aggressive_optimization = yes;}
|
||||
|
||||
//! Returns aggressive optimization
|
||||
bool aggressiveOptimization() const {return aggressive_optimization;}
|
||||
|
||||
|
||||
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_;}
|
||||
bool cryptSizeEnabled() const {return crypt_size;}
|
||||
void setCryptSizeEnabled(bool on);
|
||||
|
||||
|
||||
//! Prepare data for send and raise \a sendRequest() events
|
||||
void send(const PIByteArray & data);
|
||||
|
||||
//! Receive data part. If packet is ready, raise \a received() event
|
||||
//! Receive data part. If packet is ready, raise \a packetReceiveEvent() event
|
||||
//! and \a packetReceived() virtual method
|
||||
void received(const PIByteArray & data);
|
||||
|
||||
EVENT_HANDLER2(void, received, uchar * , readed, int, size);
|
||||
@@ -123,10 +135,10 @@ protected:
|
||||
|
||||
private:
|
||||
PIByteArray stream, packet;
|
||||
bool crypt_frag;
|
||||
bool crypt_frag, crypt_size, aggressive_optimization;
|
||||
int packet_size, crypt_frag_size;
|
||||
ushort packet_sign;
|
||||
int max_packet_size;
|
||||
int max_packet_size, size_crypted_size;
|
||||
Progress prog_s, prog_r;
|
||||
mutable PIMutex prog_s_mutex, prog_r_mutex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user