TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@80 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -21,9 +21,8 @@ PIBaseTransfer::PIBaseTransfer(): crc(standardCRC_16()), diag(false) {
|
||||
|
||||
|
||||
PIBaseTransfer::~PIBaseTransfer() {
|
||||
diag.stop();
|
||||
break_ = true;
|
||||
session.clear();
|
||||
replies.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ public:
|
||||
const llong * bytesCur_ptr() const {return &bytes_cur;}
|
||||
const PIDiagnostics &diagnostic() {return diag;}
|
||||
|
||||
EVENT_HANDLER1(void, received, PIByteArray, data);
|
||||
EVENT_HANDLER(void, stop) {stopSend(); stopReceive();}
|
||||
EVENT_HANDLER(void, pause) {setPause(true);}
|
||||
EVENT_HANDLER(void, resume) {setPause(false);}
|
||||
|
||||
EVENT(receiveStarted)
|
||||
EVENT(paused)
|
||||
EVENT(resumed)
|
||||
@@ -59,9 +64,6 @@ public:
|
||||
EVENT(sendStarted)
|
||||
EVENT1(sendFinished, bool, ok)
|
||||
EVENT1(sendRequest, PIByteArray &, data)
|
||||
EVENT_HANDLER1(void, received, PIByteArray, data);
|
||||
EVENT_HANDLER(void, pause) {setPause(true);}
|
||||
EVENT_HANDLER(void, resume) {setPause(false);}
|
||||
|
||||
protected:
|
||||
uint packet_header_size, part_header_size;
|
||||
|
||||
@@ -19,8 +19,7 @@ PIFileTransfer::PIFileTransfer() {
|
||||
|
||||
|
||||
PIFileTransfer::~PIFileTransfer() {
|
||||
break_ = true;
|
||||
files_.clear();
|
||||
stop();
|
||||
work_file.close();
|
||||
}
|
||||
|
||||
@@ -85,7 +84,10 @@ bool PIFileTransfer::sendFiles(const PIVector<PFTFileInfo> &files) {
|
||||
pftheader.step = pft_Description;
|
||||
buildSession(PIVector<Part>() << Part(0, desc.size()));
|
||||
cur_file_string = "";
|
||||
if (!send_process()) return false;
|
||||
if (!send_process()) {
|
||||
sendFilesFinished(false);
|
||||
return false;
|
||||
}
|
||||
pftheader.step = pft_Data;
|
||||
PIVector<Part> pts;
|
||||
for (int i=0; i<files_.size_s(); i++) {
|
||||
@@ -93,6 +95,7 @@ bool PIFileTransfer::sendFiles(const PIVector<PFTFileInfo> &files) {
|
||||
}
|
||||
buildSession(pts);
|
||||
bool ok = send_process();
|
||||
sendFilesFinished(ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -290,7 +293,4 @@ void PIFileTransfer::receive_finished(bool ok) {
|
||||
void PIFileTransfer::send_finished(bool ok) {
|
||||
work_file.close();
|
||||
started_ = false;
|
||||
sendFilesFinished(ok);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user