Commit ceb9fce3 authored by Pavel Vainerman's avatar Pavel Vainerman

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

parent 6e0c6fc2
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Name: libuniset2 Name: libuniset2
Version: 2.6 Version: 2.6
Release: alt29 Release: alt30
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: LGPL License: LGPL
...@@ -508,6 +508,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -508,6 +508,9 @@ rm -f %buildroot%_libdir/*.la
# history of current unpublished changes # history of current unpublished changes
%changelog %changelog
* 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,6 +125,7 @@ namespace uniset ...@@ -123,6 +125,7 @@ namespace uniset
io.start(sock->getSocket(), ev::READ); io.start(sock->getSocket(), ev::READ);
ioTimeout.set(loop); ioTimeout.set(loop);
if( sessTimeout > 0 )
ioTimeout.start(sessTimeout); ioTimeout.start(sessTimeout);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -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