Commit a14e60c7 authored by Pavel Vainerman's avatar Pavel Vainerman

[Переход на libPoco]: правки оставшегося

parent 589f752d
...@@ -95,7 +95,7 @@ class ThreadCreator: ...@@ -95,7 +95,7 @@ class ThreadCreator:
ThreadCreator( ThreadMaster* m, Action a ); ThreadCreator( ThreadMaster* m, Action a );
~ThreadCreator(); ~ThreadCreator();
inline pid_t getTID() const inline Poco::Thread::TID getTID() const
{ {
return thr.tid(); return thr.tid();
} }
...@@ -119,12 +119,6 @@ class ThreadCreator: ...@@ -119,12 +119,6 @@ class ThreadCreator:
thr.join(); thr.join();
} }
/*
inline void setCancel( ost::Thread::Cancel mode )
{
ost::PosixThread::setCancel(mode);
}
*/
inline void setFinalAction( ThreadMaster* m, Action a ) inline void setFinalAction( ThreadMaster* m, Action a )
{ {
finm = m; finm = m;
...@@ -158,8 +152,6 @@ class ThreadCreator: ...@@ -158,8 +152,6 @@ class ThreadCreator:
private: private:
ThreadCreator(); ThreadCreator();
pid_t pid = { 0 };
ThreadMaster* m; ThreadMaster* m;
Action act; Action act;
...@@ -175,7 +167,6 @@ class ThreadCreator: ...@@ -175,7 +167,6 @@ class ThreadCreator:
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
template <class ThreadMaster> template <class ThreadMaster>
ThreadCreator<ThreadMaster>::ThreadCreator( ThreadMaster* m, Action a ): ThreadCreator<ThreadMaster>::ThreadCreator( ThreadMaster* m, Action a ):
pid(0),
m(m), m(m),
act(a), act(a),
finm(0), finm(0),
...@@ -188,10 +179,12 @@ ThreadCreator<ThreadMaster>::ThreadCreator( ThreadMaster* m, Action a ): ...@@ -188,10 +179,12 @@ ThreadCreator<ThreadMaster>::ThreadCreator( ThreadMaster* m, Action a ):
template <class ThreadMaster> template <class ThreadMaster>
void ThreadCreator<ThreadMaster>::run() void ThreadCreator<ThreadMaster>::run()
{ {
pid = getpid(); initial();
if( m ) if( m )
(m->*act)(); (m->*act)();
final();
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
template <class ThreadMaster> template <class ThreadMaster>
...@@ -208,7 +201,6 @@ void ThreadCreator<ThreadMaster>::start() ...@@ -208,7 +201,6 @@ void ThreadCreator<ThreadMaster>::start()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
template <class ThreadMaster> template <class ThreadMaster>
ThreadCreator<ThreadMaster>::ThreadCreator(): ThreadCreator<ThreadMaster>::ThreadCreator():
pid(0),
m(0), m(0),
act(0), act(0),
finm(0), finm(0),
......
...@@ -58,9 +58,12 @@ size_t ModbusTCPCore::readNextData(UTCPStream* tcp, ...@@ -58,9 +58,12 @@ size_t ModbusTCPCore::readNextData(UTCPStream* tcp,
if( l == 0 ) if( l == 0 )
commfail = true; commfail = true;
} }
catch( Poco::TimeoutException& ex )
{
}
catch( Poco::Net::NetException& e ) catch( Poco::Net::NetException& e )
{ {
#warning Разобраться с Poco::Net::NetException
commfail = true; commfail = 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