summaryrefslogtreecommitdiff
path: root/cppe/src/TcpTransport/Transceiver.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-05-24 09:48:59 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-05-24 09:48:59 +0000
commit5aaab4501f6776a4a3fdcac7a84ca3308e136422 (patch)
tree100ce3aff9f3137755c578c0fff1726aee0f3dc3 /cppe/src/TcpTransport/Transceiver.cpp
parentfix bug with uncheckedCast (diff)
downloadice-5aaab4501f6776a4a3fdcac7a84ca3308e136422.tar.bz2
ice-5aaab4501f6776a4a3fdcac7a84ca3308e136422.tar.xz
ice-5aaab4501f6776a4a3fdcac7a84ca3308e136422.zip
Added Ice.TCP.SndSize/Ice.TCP.RcvSize properties.
Diffstat (limited to 'cppe/src/TcpTransport/Transceiver.cpp')
-rw-r--r--cppe/src/TcpTransport/Transceiver.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/cppe/src/TcpTransport/Transceiver.cpp b/cppe/src/TcpTransport/Transceiver.cpp
index 9ee819d8057..8f0d18b5f4c 100644
--- a/cppe/src/TcpTransport/Transceiver.cpp
+++ b/cppe/src/TcpTransport/Transceiver.cpp
@@ -113,9 +113,9 @@ IceInternal::Transceiver::writeWithTimeout(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
@@ -378,9 +378,6 @@ IceInternal::Transceiver::Transceiver(const InstancePtr& instance, SOCKET fd) :
_readTimeout(-1),
_writeTimeout(-1),
_desc(fdToString(fd))
-#ifdef _WIN32
- , _isPeerLocal(isPeerLocal(fd))
-#endif
{
#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS
#ifdef _WIN32
@@ -430,6 +427,19 @@ IceInternal::Transceiver::Transceiver(const InstancePtr& instance, SOCKET fd) :
FD_ZERO(&_rFdSet);
#endif
#endif
+
+#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 = getSendBufferSize(_fd) / 2;
+ if(_maxPacketSize < 512)
+ {
+ _maxPacketSize = 512; // Make sure the packet size limiter isn't too small.
+ }
+#endif
}
IceInternal::Transceiver::~Transceiver()