diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-05-14 00:23:01 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-05-14 00:23:01 +0000 |
commit | 6728a6037d0542da5886976c0498e64db98c0d71 (patch) | |
tree | 3f2d7baf96ee8d13201b22ddcee6aa0976134477 /cpp/src/IceSSL/SslTransceiver.cpp | |
parent | catch unknown exceptions from entry point (diff) | |
download | ice-6728a6037d0542da5886976c0498e64db98c0d71.tar.bz2 ice-6728a6037d0542da5886976c0498e64db98c0d71.tar.xz ice-6728a6037d0542da5886976c0498e64db98c0d71.zip |
Updated to fix a problem with SSL server shutdown.
Diffstat (limited to 'cpp/src/IceSSL/SslTransceiver.cpp')
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp index ebf5508e280..64dc4b002d7 100644 --- a/cpp/src/IceSSL/SslTransceiver.cpp +++ b/cpp/src/IceSSL/SslTransceiver.cpp @@ -40,7 +40,17 @@ IceSSL::SslTransceiver::close() SOCKET fd = _fd; _fd = INVALID_SOCKET; - _sslConnection->shutdown(); + + int shutdown = 0; + int numRetries = 100; + int retries = -numRetries; + do + { + shutdown = _sslConnection->shutdown(); + retries++; + } + while ((shutdown == 0) && (retries < 0)); + ::shutdown(fd, SHUT_RDWR); // helps to unblock threads in recv() closeSocket(fd); } @@ -55,7 +65,16 @@ IceSSL::SslTransceiver::shutdown() _logger->trace(_traceLevels->networkCat, s.str()); } - _sslConnection->shutdown(); + int shutdown = 0; + int numRetries = 100; + int retries = -numRetries; + do + { + shutdown = _sslConnection->shutdown(); + retries++; + } + while ((shutdown == 0) && (retries < 0)); + ::shutdown(_fd, SHUT_WR); // Shutdown socket for writing } |