summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-05-23 12:49:48 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-05-23 12:49:48 +0000
commit4f11b3b9bc858d7a5a8741fcb06ca61ce8189d6c (patch)
tree3fa912fd7db2b611fb76a8f7bc9547c39737b024 /cpp/src/IceSSL
parentFixed VS8 compilation error (diff)
downloadice-4f11b3b9bc858d7a5a8741fcb06ca61ce8189d6c.tar.bz2
ice-4f11b3b9bc858d7a5a8741fcb06ca61ce8189d6c.tar.xz
ice-4f11b3b9bc858d7a5a8741fcb06ca61ce8189d6c.zip
Added Ice.TCP.SndSize/Ice.TCP.RcvSize properties, fixed throughput issue on
Win32.
Diffstat (limited to 'cpp/src/IceSSL')
-rw-r--r--cpp/src/IceSSL/AcceptorI.cpp2
-rw-r--r--cpp/src/IceSSL/ConnectorI.cpp1
-rw-r--r--cpp/src/IceSSL/TransceiverI.cpp17
-rw-r--r--cpp/src/IceSSL/TransceiverI.h2
4 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/IceSSL/AcceptorI.cpp b/cpp/src/IceSSL/AcceptorI.cpp
index 2bd7a3e105c..b2fec924caa 100644
--- a/cpp/src/IceSSL/AcceptorI.cpp
+++ b/cpp/src/IceSSL/AcceptorI.cpp
@@ -77,6 +77,7 @@ IceSSL::AcceptorI::accept(int timeout)
SOCKET fd = IceInternal::doAccept(_fd, timeout);
IceInternal::setBlock(fd, false);
+ IceInternal::setTcpBufSize(fd, _instance->communicator()->getProperties(), _logger);
BIO* bio = BIO_new_socket(static_cast<int>(fd), BIO_CLOSE);
if(!bio)
@@ -155,6 +156,7 @@ IceSSL::AcceptorI::AcceptorI(const InstancePtr& instance, const string& adapterN
_fd = IceInternal::createSocket(false);
IceInternal::setBlock(_fd, false);
IceInternal::getAddress(host, port, _addr);
+ IceInternal::setTcpBufSize(_fd, _instance->communicator()->getProperties(), _logger);
if(_instance->networkTraceLevel() >= 2)
{
Trace out(_logger, _instance->networkTraceCategory());
diff --git a/cpp/src/IceSSL/ConnectorI.cpp b/cpp/src/IceSSL/ConnectorI.cpp
index 8a68c3559c3..ffda1471012 100644
--- a/cpp/src/IceSSL/ConnectorI.cpp
+++ b/cpp/src/IceSSL/ConnectorI.cpp
@@ -41,6 +41,7 @@ IceSSL::ConnectorI::connect(int timeout)
SOCKET fd = IceInternal::createSocket(false);
IceInternal::setBlock(fd, false);
+ IceInternal::setTcpBufSize(fd, _instance->communicator()->getProperties(), _logger);
IceInternal::doConnect(fd, _addr, timeout);
// This static_cast is necessary due to 64bit windows. There SOCKET is a non-int type.
diff --git a/cpp/src/IceSSL/TransceiverI.cpp b/cpp/src/IceSSL/TransceiverI.cpp
index 7f51ac52c76..705f02e2071 100644
--- a/cpp/src/IceSSL/TransceiverI.cpp
+++ b/cpp/src/IceSSL/TransceiverI.cpp
@@ -87,9 +87,9 @@ IceSSL::TransceiverI::write(IceInternal::Buffer& buf, int timeout)
//
// Limit packet size to avoid performance problems on WIN32
//
- if(_isPeerLocal && packetSize > 64 * 1024)
+ if(packetSize > _maxPacketSize)
{
- packetSize = 64 * 1024;
+ packetSize = _maxPacketSize;
}
#endif
@@ -541,10 +541,19 @@ IceSSL::TransceiverI::TransceiverI(const InstancePtr& instance, SSL* ssl, SOCKET
_adapterName(adapterName),
_incoming(incoming),
_desc(IceInternal::fdToString(fd))
+{
#ifdef _WIN32
- , _isPeerLocal(IceInternal::isPeerLocal(fd))
+ //
+ // On Windows, limiting the buffer size is important to prevent
+ // poor throughput performances when transfering large amount of
+ // data. See Microsoft KB article KB823764.
+ //
+ _maxPacketSize = IceInternal::getSendBufferSize(_fd) / 2;
+ if(_maxPacketSize < 512)
+ {
+ _maxPacketSize = 0;
+ }
#endif
-{
}
IceSSL::TransceiverI::~TransceiverI()
diff --git a/cpp/src/IceSSL/TransceiverI.h b/cpp/src/IceSSL/TransceiverI.h
index 46daa6d9570..d20915ea5f2 100644
--- a/cpp/src/IceSSL/TransceiverI.h
+++ b/cpp/src/IceSSL/TransceiverI.h
@@ -63,7 +63,7 @@ private:
const std::string _desc;
#ifdef _WIN32
- const bool _isPeerLocal;
+ int _maxPacketSize;
#endif
};
typedef IceUtil::Handle<TransceiverI> TransceiverIPtr;