summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionSettings.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-08-05 17:03:16 +0000
committerGordon Sim <gsim@apache.org>2008-08-05 17:03:16 +0000
commitbd47fd629bb2356df93af70b174a6a070f3a58cc (patch)
treec92b2cc932fe806ce9e41521de9f4d01557ec2ba /cpp/src/qpid/client/ConnectionSettings.cpp
parent6bed4cf29dda54560af44d16143fa4b24b65245b (diff)
downloadqpid-python-bd47fd629bb2356df93af70b174a6a070f3a58cc.tar.gz
* 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
Diffstat (limited to 'cpp/src/qpid/client/ConnectionSettings.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionSettings.cpp12
1 files changed, 4 insertions, 8 deletions
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 <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
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");
}
}