summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/TcpTransceiver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/TcpTransceiver.cpp')
-rw-r--r--cpp/src/Ice/TcpTransceiver.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp
index bfe6cee14d0..6586aee2201 100644
--- a/cpp/src/Ice/TcpTransceiver.cpp
+++ b/cpp/src/Ice/TcpTransceiver.cpp
@@ -81,6 +81,16 @@ IceInternal::TcpTransceiver::write(Buffer& buf, int timeout)
Buffer::Container::difference_type packetSize =
static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i);
+#ifdef _WIN32
+ //
+ // Limit packet size to avoid performance problems on WIN32
+ //
+ if(_isPeerLocal && packetSize > 64 * 1024)
+ {
+ packetSize = 64 * 1024;
+ }
+#endif
+
while(buf.i != buf.b.end())
{
assert(_fd != INVALID_SOCKET);
@@ -322,6 +332,9 @@ IceInternal::TcpTransceiver::TcpTransceiver(const InstancePtr& instance, SOCKET
_stats(instance->stats()),
_fd(fd),
_desc(fdToString(fd))
+#ifdef _WIN32
+ , _isPeerLocal(isPeerLocal(fd))
+#endif
{
FD_ZERO(&_rFdSet);
FD_ZERO(&_wFdSet);