diff options
| author | Gordon Sim <gsim@apache.org> | 2008-08-05 17:03:16 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-08-05 17:03:16 +0000 |
| commit | bd47fd629bb2356df93af70b174a6a070f3a58cc (patch) | |
| tree | c92b2cc932fe806ce9e41521de9f4d01557ec2ba /cpp/src/qpid/client/ConnectionSettings.cpp | |
| parent | 6bed4cf29dda54560af44d16143fa4b24b65245b (diff) | |
| download | qpid-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.cpp | 12 |
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"); } } |
