Commit a32f180d authored by Pavel Vainerman's avatar Pavel Vainerman

Разборка с ev::timer

parent d48e4892
...@@ -511,6 +511,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -511,6 +511,9 @@ rm -f %buildroot%_libdir/*.la
* Tue Sep 12 2017 Alexei Takaseev <taf@altlinux.org> 2.6-alt19.1 * Tue Sep 12 2017 Alexei Takaseev <taf@altlinux.org> 2.6-alt19.1
- Rebuild with poco 1.7.9 - Rebuild with poco 1.7.9
# * Sat Jun 03 2017 Pavel Vainerman <pv@altlinux.ru> 2.6-alt30
# - test build (devel)
# * Fri Jun 02 2017 Pavel Vainerman <pv@altlinux.ru> 2.6-alt29 # * Fri Jun 02 2017 Pavel Vainerman <pv@altlinux.ru> 2.6-alt29
# - test build (devel) # - test build (devel)
......
...@@ -150,7 +150,6 @@ namespace uniset ...@@ -150,7 +150,6 @@ namespace uniset
private: private:
timeout_t timeout = { UniSetTimer::WaitUpTime };
timeout_t cmdTimeout = { 2000 }; timeout_t cmdTimeout = { 2000 };
Debug::type sessLogLevel = { Debug::NONE }; Debug::type sessLogLevel = { Debug::NONE };
size_t sessMaxCount = { 10 }; size_t sessMaxCount = { 10 };
......
...@@ -105,7 +105,7 @@ namespace uniset ...@@ -105,7 +105,7 @@ namespace uniset
void logOnEvent( const std::string& s ) noexcept; void logOnEvent( const std::string& s ) noexcept;
timeout_t cmdTimeout = { 2000 }; timeout_t cmdTimeout = { 2000 };
float checkConnectionTime = { 10. }; // время на проверку живости соединения..(сек) double checkConnectionTime = { 10. }; // время на проверку живости соединения..(сек)
// Т.к. сообщений может быть ОЧЕНЬ МНОГО.. сеть медленная // Т.к. сообщений может быть ОЧЕНЬ МНОГО.. сеть медленная
// очередь будет не успевать рассасываться, // очередь будет не успевать рассасываться,
......
...@@ -102,7 +102,9 @@ namespace uniset ...@@ -102,7 +102,9 @@ namespace uniset
{ {
sessTimeout = t; sessTimeout = t;
if( ioTimeout.is_active() ) if( t <= 0 )
ioTimeout.stop();
else if( ioTimeout.is_active() )
ioTimeout.start(t); ioTimeout.start(t);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -123,7 +125,8 @@ namespace uniset ...@@ -123,7 +125,8 @@ namespace uniset
io.start(sock->getSocket(), ev::READ); io.start(sock->getSocket(), ev::READ);
ioTimeout.set(loop); ioTimeout.set(loop);
ioTimeout.start(sessTimeout); if( sessTimeout > 0 )
ioTimeout.start(sessTimeout);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
bool ModbusTCPSession::isActive() const bool ModbusTCPSession::isActive() const
...@@ -159,7 +162,7 @@ namespace uniset ...@@ -159,7 +162,7 @@ namespace uniset
terminate(); terminate();
} }
else else if( sessTimeout > 0 )
ioTimeout.start(sessTimeout); // restart timer.. ioTimeout.start(sessTimeout); // restart timer..
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
...@@ -70,7 +70,6 @@ namespace uniset ...@@ -70,7 +70,6 @@ namespace uniset
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
LogServer::LogServer(): LogServer::LogServer():
timeout(UniSetTimer::WaitUpTime),
cmdTimeout(2000), cmdTimeout(2000),
sessLogLevel(Debug::NONE), sessLogLevel(Debug::NONE),
sock(nullptr), sock(nullptr),
......
...@@ -246,9 +246,9 @@ namespace uniset ...@@ -246,9 +246,9 @@ namespace uniset
evterm.start(); evterm.start();
evprep.start(); evprep.start();
// делаем очень маленькое время старта // нам нужен "одноразовый таймер"
// т.к. нам надо просто зафиксировать, что loop начал работать // т.к. нам надо просто зафиксировать, что loop начал работать
evruntimer.start(0, 0.001); evruntimer.start(0);
isrunning = true; isrunning = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment