From f458ec7b59e6c03f59e8b33474bbe70f9a9873dc Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 13 Aug 2007 09:41:45 +0000 Subject: Fixes for QPID-544 and QPID-548 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@565284 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/common/sys/Socket.h | 1 + cpp/lib/common/sys/apr/Socket.cpp | 4 ++++ cpp/lib/common/sys/posix/Socket.cpp | 2 ++ 3 files changed, 7 insertions(+) (limited to 'cpp/lib/common') diff --git a/cpp/lib/common/sys/Socket.h b/cpp/lib/common/sys/Socket.h index d793a240c6..b5f74847c2 100644 --- a/cpp/lib/common/sys/Socket.h +++ b/cpp/lib/common/sys/Socket.h @@ -47,6 +47,7 @@ class Socket /** Set timeout for read and write */ void setTimeout(Time interval); + void setTcpNoDelay(bool on); void connect(const std::string& host, int port); diff --git a/cpp/lib/common/sys/apr/Socket.cpp b/cpp/lib/common/sys/apr/Socket.cpp index ab98c07479..c2abf50c5f 100644 --- a/cpp/lib/common/sys/apr/Socket.cpp +++ b/cpp/lib/common/sys/apr/Socket.cpp @@ -87,4 +87,8 @@ ssize_t Socket::recv(void* data, size_t size) return received; } +void Socket::setTcpNoDelay(bool on) +{ + CHECK_APR_SUCCESS(apr_socket_opt_set(socket, APR_TCP_NODELAY, on ? 1 : 0)); +} diff --git a/cpp/lib/common/sys/posix/Socket.cpp b/cpp/lib/common/sys/posix/Socket.cpp index 5bd13742f6..e27ced9161 100644 --- a/cpp/lib/common/sys/posix/Socket.cpp +++ b/cpp/lib/common/sys/posix/Socket.cpp @@ -116,3 +116,5 @@ int Socket::fd() { return socket; } + +void Socket::setTcpNoDelay(bool) {} //not yet implemented -- cgit v1.2.1