summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/TcpTransceiver.cpp
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/Ice/TcpTransceiver.cpp
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/Ice/TcpTransceiver.cpp')
-rw-r--r--cpp/src/Ice/TcpTransceiver.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp
index 541843223b7..200778293c6 100644
--- a/cpp/src/Ice/TcpTransceiver.cpp
+++ b/cpp/src/Ice/TcpTransceiver.cpp
@@ -85,9 +85,9 @@ IceInternal::TcpTransceiver::write(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
@@ -358,12 +358,22 @@ IceInternal::TcpTransceiver::TcpTransceiver(const InstancePtr& instance, SOCKET
_stats(instance->initializationData().stats),
_fd(fd),
_desc(fdToString(fd))
-#ifdef _WIN32
- , _isPeerLocal(isPeerLocal(fd))
-#endif
{
FD_ZERO(&_rFdSet);
FD_ZERO(&_wFdSet);
+
+#ifdef _WIN32
+ //
+ // 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
}
IceInternal::TcpTransceiver::~TcpTransceiver()