[DEV] change Time type std::chrono to echrono

This commit is contained in:
Edouard DUPIN 2017-01-04 22:22:25 +01:00
parent 85c8aeaad8
commit 65ff5fb439
2 changed files with 9 additions and 8 deletions

View File

@ -167,7 +167,7 @@ void enet::WebSocket::onReceiveData(enet::Tcp& _connection) {
ENET_VERBOSE("ReadRaw 2 [STOP]");
return;
}
m_lastReceive = std::chrono::steady_clock::now();
m_lastReceive = echrono::Steady::now();
if ((opcode & 0x80) == 0) {
ENET_ERROR("Multiple frames ... NOT managed ... : " << (opcode & 0x80) << (opcode & 0x40) << (opcode & 0x20) << (opcode & 0x10) << (opcode & 0x08) << (opcode & 0x04) << (opcode & 0x02) << (opcode & 0x01));
m_interface->stop(true);
@ -510,7 +510,7 @@ void enet::WebSocket::controlPing() {
}
uint8_t header = enet::websocket::FLAG_FIN
| enet::websocket::OPCODE_FRAME_PING;
m_lastSend = std::chrono::steady_clock::now();
m_lastSend = echrono::Steady::now();
m_interface->write(&header, sizeof(uint8_t));
header = 0;
m_interface->write(&header, sizeof(uint8_t));
@ -523,7 +523,7 @@ void enet::WebSocket::controlPong() {
}
uint8_t header = enet::websocket::FLAG_FIN
| enet::websocket::OPCODE_FRAME_PONG;
m_lastSend = std::chrono::steady_clock::now();
m_lastSend = echrono::Steady::now();
m_interface->write(&header, sizeof(uint8_t));
header = 0;
m_interface->write(&header, sizeof(uint8_t));
@ -536,7 +536,7 @@ void enet::WebSocket::controlClose() {
}
uint8_t header = enet::websocket::FLAG_FIN
| enet::websocket::OPCODE_FRAME_CLOSE;
m_lastSend = std::chrono::steady_clock::now();
m_lastSend = echrono::Steady::now();
m_interface->write(&header, sizeof(uint8_t));
header = 0;
m_interface->write(&header, sizeof(uint8_t));

View File

@ -7,6 +7,7 @@
#include <enet/Http.hpp>
#include <ememory/memory.hpp>
#include <echrono/Steady.hpp>
#include <vector>
#include <map>
@ -18,13 +19,13 @@ namespace enet {
ememory::SharedPtr<enet::Http> m_interface;
std::vector<uint8_t> m_buffer;
std::string m_checkKey;
std::chrono::steady_clock::time_point m_lastReceive;
std::chrono::steady_clock::time_point m_lastSend;
echrono::Steady m_lastReceive;
echrono::Steady m_lastSend;
public:
const std::chrono::steady_clock::time_point& getLastTimeReceive() {
const echrono::Steady& getLastTimeReceive() {
return m_lastReceive;
}
const std::chrono::steady_clock::time_point& getLastTimeSend() {
const echrono::Steady& getLastTimeSend() {
return m_lastSend;
}
public: