TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@72 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -4,6 +4,18 @@
|
||||
|
||||
extern PIScreen screen;
|
||||
|
||||
|
||||
Daemon::Remote::Remote(const PIString & n): PIThread() {
|
||||
setName(n);
|
||||
ft.setName(n);
|
||||
CONNECTU(&ft, sendRequest, this, ftSendRequest)
|
||||
CONNECTU(&ft, receiveFinished, this, ftReceived)
|
||||
dir_my = PIDir::current();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Daemon::Daemon(): PIPeer("_pisd_" + PISystemInfo::instance()->hostname + "_" + PIString(rand() % 100)), fm(this) {
|
||||
setName("Daemon");
|
||||
timer.setName("__S__Daemon_timer");
|
||||
@@ -228,8 +240,8 @@ void Daemon::peerConnected(const PIString & name) {
|
||||
mode = 2;
|
||||
conn_name = name;*/
|
||||
Remote * r = new Remote(name);
|
||||
CONNECTU(&(r->dt), sendRequest, this, dtSendRequest)
|
||||
CONNECTU(&(r->dt), receiveFinished, this, dtReceived)
|
||||
CONNECTU(&(r->ft), sendRequest, this, ftSendRequest)
|
||||
CONNECTU(&(r->ft), receiveFinished, this, ftReceived)
|
||||
remotes.insert(name, r);
|
||||
}
|
||||
|
||||
@@ -244,7 +256,7 @@ void Daemon::peerDisconnected(const PIString & name) {
|
||||
}
|
||||
|
||||
|
||||
void Daemon::dtSendRequest(PIByteArray & data) {
|
||||
void Daemon::ftSendRequest(PIByteArray & data) {
|
||||
PIDataTransfer * dt = (PIDataTransfer*)emitter();
|
||||
if (!dt) return;
|
||||
PIByteArray hdr; hdr << int(DataTransfer);
|
||||
@@ -253,7 +265,7 @@ void Daemon::dtSendRequest(PIByteArray & data) {
|
||||
}
|
||||
|
||||
|
||||
void Daemon::dtReceived(bool ok) {
|
||||
void Daemon::ftReceived(bool ok) {
|
||||
if (!ok) return;
|
||||
PIDataTransfer * dt = (PIDataTransfer*)emitter();
|
||||
if (!dt) return;
|
||||
@@ -304,11 +316,6 @@ void Daemon::dataReceived(const PIString & from, const PIByteArray & data) {
|
||||
fm.remoteRestoreDir();
|
||||
}
|
||||
break;
|
||||
case DataTransfer:
|
||||
r = remotes.value(from);
|
||||
if (r)
|
||||
r->dt.received(ba);
|
||||
break;
|
||||
};
|
||||
if (!rba.isEmpty()) send(from, rba);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user