From 3a87c67be419a3ae74ea456ae67be5d0f2d2ec92 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 9 May 2007 17:00:32 +0000 Subject: * Added support for channel.flow: cpp/tests/ChannelTest.cpp cpp/lib/broker/SessionHandlerImpl.cpp cpp/lib/broker/BrokerChannel.h cpp/lib/broker/BrokerChannel.cpp * Fixed client connection closing process: cpp/lib/common/sys/apr/Socket.cpp cpp/lib/client/Connector.h cpp/lib/client/Connector.cpp cpp/lib/client/Connection.h cpp/lib/client/Connection.cpp * Use amq.direct rather than default exchange in P2P test (to interop with java) cpp/tests/BasicP2Ptest.h git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@536584 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/common/sys/apr/Socket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpp/lib/common/sys/apr/Socket.cpp') diff --git a/cpp/lib/common/sys/apr/Socket.cpp b/cpp/lib/common/sys/apr/Socket.cpp index 336eb4996a..5a5dc2a615 100644 --- a/cpp/lib/common/sys/apr/Socket.cpp +++ b/cpp/lib/common/sys/apr/Socket.cpp @@ -24,6 +24,7 @@ #include #include +#include using namespace qpid::sys; @@ -55,6 +56,7 @@ void Socket::connect(const std::string& host, int port) { void Socket::close() { if (socket == 0) return; + CHECK_APR_SUCCESS(apr_socket_shutdown(socket, APR_SHUTDOWN_READWRITE)); CHECK_APR_SUCCESS(apr_socket_close(socket)); socket = 0; } @@ -76,8 +78,9 @@ ssize_t Socket::recv(void* data, size_t size) apr_status_t status = apr_socket_recv(socket, reinterpret_cast(data), &received); if (APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT; + if (APR_STATUS_IS_EOF(status)) return SOCKET_EOF; CHECK_APR_SUCCESS(status); - return received; + return received; } -- cgit v1.2.1