blob: b9fbbd11cdbdf41e397ce6d36c4cd2b0485829ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "Swiften/StreamStack/WhitespacePingLayer.h"
#include "Swiften/Network/Timer.h"
namespace Swift {
static const int TIMEOUT_MILLISECONDS = 60000;
WhitespacePingLayer::WhitespacePingLayer() {
timer_ = new Timer(TIMEOUT_MILLISECONDS);
timer_->onTick.connect(boost::bind(&WhitespacePingLayer::handleTimerTick, this));
timer_->start();
}
WhitespacePingLayer::~WhitespacePingLayer() {
delete timer_;
}
void WhitespacePingLayer::writeData(const ByteArray& data) {
onWriteData(data);
}
void WhitespacePingLayer::handleDataRead(const ByteArray& data) {
onDataRead(data);
}
void WhitespacePingLayer::handleTimerTick() {
onWriteData(" ");
}
}
|