|
|
@@ -25,6 +25,7 @@
|
|
|
#include "Poco/Util/Application.h"
|
|
|
#include "Poco/Util/AbstractConfiguration.h"
|
|
|
#include "Poco/Thread.h"
|
|
|
+#include "Poco/Mutex.h"
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
@@ -46,6 +47,8 @@ using Poco::Util::Application;
|
|
|
|
|
|
namespace
|
|
|
{
|
|
|
+ static Poco::FastMutex cerrMutex;
|
|
|
+
|
|
|
class EchoConnection: public TCPServerConnection
|
|
|
{
|
|
|
public:
|
|
|
@@ -66,8 +69,10 @@ namespace
|
|
|
n = ss.receiveBytes(buffer, sizeof(buffer));
|
|
|
}
|
|
|
}
|
|
|
- catch (Poco::Exception& exc)
|
|
|
+ catch (const Poco::Exception& exc)
|
|
|
{
|
|
|
+ Poco::FastMutex::ScopedLock l(cerrMutex);
|
|
|
+
|
|
|
std::cerr << "EchoConnection: " << exc.displayText() << std::endl;
|
|
|
}
|
|
|
}
|