From bd47fd629bb2356df93af70b174a6a070f3a58cc Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 5 Aug 2008 17:03:16 +0000 Subject: * revised approach for setting tcp-nodelay on client to avoid breaking platform abstractions * added ability to set tcp-nodelay on server side of the socket also Merged from r682785. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@682791 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionSettings.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cpp/src/qpid/client/ConnectionSettings.cpp') diff --git a/cpp/src/qpid/client/ConnectionSettings.cpp b/cpp/src/qpid/client/ConnectionSettings.cpp index ea4e20b529..6bc220cd41 100644 --- a/cpp/src/qpid/client/ConnectionSettings.cpp +++ b/cpp/src/qpid/client/ConnectionSettings.cpp @@ -21,10 +21,8 @@ #include "ConnectionSettings.h" #include "qpid/log/Logger.h" -#include "qpid/sys/posix/check.h" +#include "qpid/sys/Socket.h" #include -#include -#include namespace qpid { namespace client { @@ -45,13 +43,11 @@ ConnectionSettings::ConnectionSettings() : ConnectionSettings::~ConnectionSettings() {} -void ConnectionSettings::configurePosixTcpSocket(int fd) const +void ConnectionSettings::configureSocket(qpid::sys::Socket& socket) const { if (tcpNoDelay) { - int flag = 1; - int result = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)); - QPID_POSIX_CHECK(result); - QPID_LOG(debug, "Set TCP_NODELAY"); + socket.setTcpNoDelay(tcpNoDelay); + QPID_LOG(info, "Set TCP_NODELAY"); } } -- cgit v1.2.1