From fbddf29b719cd610b01b2459c4827d636cda6c73 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 9 Sep 2009 19:46:56 +0000 Subject: Tidied up namespace usage Miscelleneous whitespace fixes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@813094 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/SocketProxy.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'cpp/src/tests/SocketProxy.h') diff --git a/cpp/src/tests/SocketProxy.h b/cpp/src/tests/SocketProxy.h index ccce3c8842..9df32a1336 100644 --- a/cpp/src/tests/SocketProxy.h +++ b/cpp/src/tests/SocketProxy.h @@ -35,8 +35,11 @@ #include "qpid/sys/Mutex.h" #include "qpid/log/Statement.h" +namespace qpid { +namespace tests { + /** - * A simple socket proxy that forwards to another socket. + * A simple socket proxy that forwards to another socket. * Used between client & local broker to simulate network failures. */ class SocketProxy : private qpid::sys::Runnable @@ -59,7 +62,7 @@ class SocketProxy : private qpid::sys::Runnable joined = false; thread = qpid::sys::Thread(static_cast(this)); } - + ~SocketProxy() { close(); if (!joined) thread.join(); } /** Simulate a network disconnect. */ @@ -88,7 +91,7 @@ class SocketProxy : private qpid::sys::Runnable } uint16_t getPort() const { return port; } - + private: static void throwErrno(const std::string& msg) { throw qpid::Exception(msg+":"+qpid::sys::strError(errno)); @@ -153,7 +156,7 @@ class SocketProxy : private qpid::sys::Runnable } try { if (server.get()) server->close(); - close(); + close(); } catch (const std::exception& e) { QPID_LOG(debug, "SocketProxy::run exception in client/server close()" << e.what()); @@ -169,4 +172,6 @@ class SocketProxy : private qpid::sys::Runnable bool dropClient, dropServer; }; +}} // namespace qpid::tests + #endif -- cgit v1.2.1