summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/SocketProxy.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-11 15:29:54 +0000
committerAlan Conway <aconway@apache.org>2007-12-11 15:29:54 +0000
commita1ac9e3af90d2f3ec06fc1bf510d3e1d963ca4aa (patch)
tree8051231b215b379f8cf57fa1a173071694e177fd /qpid/cpp/src/tests/SocketProxy.h
parentd4881839ec7780a125331167e943c3069938e43b (diff)
downloadqpid-python-a1ac9e3af90d2f3ec06fc1bf510d3e1d963ca4aa.tar.gz
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@603273 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/SocketProxy.h')
-rw-r--r--qpid/cpp/src/tests/SocketProxy.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/qpid/cpp/src/tests/SocketProxy.h b/qpid/cpp/src/tests/SocketProxy.h
index 03d9b6ad35..b985ded175 100644
--- a/qpid/cpp/src/tests/SocketProxy.h
+++ b/qpid/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;