From 71a8ad99f6d6cefa6a500c5600c9af1a194540b1 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 11 Dec 2007 15:29:54 +0000 Subject: src/tests/ClientSessionTest.cpp: Disabled hanging test: testDisconnectResume. src/tests/SocketProxy.h: fixed exception handling. src/tests/exception_test.cpp: fixed compile error. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@603273 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/SocketProxy.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'cpp/src/tests/SocketProxy.h') diff --git a/cpp/src/tests/SocketProxy.h b/cpp/src/tests/SocketProxy.h index 03d9b6ad35..b985ded175 100644 --- a/cpp/src/tests/SocketProxy.h +++ b/cpp/src/tests/SocketProxy.h @@ -41,20 +41,22 @@ struct SocketProxy : public qpid::sys::Runnable private: - void init(const std::string& host, int port) { - client.connect(host,port); + void init(const std::string& host, int connectPort) { + client.connect(host, connectPort); port = server.listen(); thread=qpid::sys::Thread(this); } void run() { - do { - ssize_t recv = server.recv(buffer, sizeof(buffer)); - if (recv <= 0) return; - ssize_t sent=client.send(buffer, recv); - if (sent < 0) return; - assert(sent == recv); // Assumes we can send as we receive. - } while (true); + try { + do { + ssize_t recv = server.recv(buffer, sizeof(buffer)); + if (recv <= 0) return; + ssize_t sent=client.send(buffer, recv); + if (sent < 0) return; + assert(sent == recv); // Assumes we can send as we receive. + } while (true); + } catch(...) {} } qpid::sys::Thread thread; -- cgit v1.2.1