-\r
- m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"FreenetMasterThread::run could not connect to node. Waiting 60 seconds.");\r
-\r
- // wait 60 seconds - will then try to connect again\r
- /*\r
- try\r
+ // wait at least 1 minute since last successful connect\r
+ now=Poco::Timestamp();\r
+ if(lastconnected<=(now-Poco::Timespan(0,0,1,0,0)))\r
+ {\r
+ if(FCPConnect()==false)\r
+ {\r
+\r
+ m_log->error("FreenetMasterThread::run could not connect to node. Waiting 60 seconds.");\r
+\r
+ for(int i=0; i<60 && !IsCancelled(); i++)\r
+ {\r
+ Poco::Thread::sleep(1000);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ lastreceivedmessage=Poco::Timestamp();\r
+ lastconnected=Poco::Timestamp();\r
+ }\r
+ }\r
+ else\r