summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-09-23 10:54:29 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-09-23 10:54:29 -0230
commit0e5a650f2b2085c823c4529fcf55b85706c3c1ee (patch)
tree35d1f338e25e5224681bfa5c6e52a8358bd11b01 /cpp/src
parentICE-5670 - interrupt test failure (diff)
downloadice-0e5a650f2b2085c823c4529fcf55b85706c3c1ee.tar.bz2
ice-0e5a650f2b2085c823c4529fcf55b85706c3c1ee.tar.xz
ice-0e5a650f2b2085c823c4529fcf55b85706c3c1ee.zip
Minor change to Udptransceiver to ensure proper tracing on failure
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp10
-rw-r--r--cpp/src/Ice/ConnectionFactory.h2
-rw-r--r--cpp/src/Ice/Network.cpp6
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp3
4 files changed, 11 insertions, 10 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index 44401760b4f..f859ac3fa58 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -1678,7 +1678,7 @@ IceInternal::IncomingConnectionFactory::initialize(const string& oaName)
{
try
{
- closeAcceptor();
+ closeAcceptor(false);
}
catch(const Ice::LocalException&)
{
@@ -1768,7 +1768,7 @@ IceInternal::IncomingConnectionFactory::setState(State state)
//
if(_acceptor)
{
- closeAcceptor();
+ closeAcceptor(true);
}
#endif
for_each(_connections.begin(), _connections.end(),
@@ -1782,7 +1782,7 @@ IceInternal::IncomingConnectionFactory::setState(State state)
#if !defined(ICE_USE_IOCP) && !defined(ICE_OS_WINRT)
if(_acceptor)
{
- closeAcceptor();
+ closeAcceptor(true);
}
#endif
break;
@@ -1794,9 +1794,9 @@ IceInternal::IncomingConnectionFactory::setState(State state)
}
void
-IceInternal::IncomingConnectionFactory::closeAcceptor()
+IceInternal::IncomingConnectionFactory::closeAcceptor(bool trace)
{
- if(_instance->traceLevels()->network >= 1)
+ if(trace && _instance->traceLevels()->network >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
out << "stopping to accept " << _endpoint->protocol() << " connections at " << _acceptor->toString();
diff --git a/cpp/src/Ice/ConnectionFactory.h b/cpp/src/Ice/ConnectionFactory.h
index 8f318914600..bd0bbe30804 100644
--- a/cpp/src/Ice/ConnectionFactory.h
+++ b/cpp/src/Ice/ConnectionFactory.h
@@ -213,7 +213,7 @@ private:
};
void setState(State);
- void closeAcceptor();
+ void closeAcceptor(bool);
const InstancePtr _instance;
const FactoryACMMonitorPtr _monitor;
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 823529753a7..0dd99cd5ae6 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -838,7 +838,7 @@ IceInternal::getAddresses(const string& host, int port, ProtocolSupport, Ice::En
// to Windows API.
//
addr.host = ref new HostName(ref new String(
- IceUtil::stringToWstring(host,
+ IceUtil::stringToWstring(host,
IceUtil::getProcessStringConverter()).c_str()));
}
stringstream os;
@@ -1958,7 +1958,7 @@ IceInternal::doBind(SOCKET fd, const Address& addr)
}
else
{
- checkResultAndWait(listener->BindEndpointAsync(addr.host, addr.port));
+ checkResultAndWait(listener->BindEndpointAsync(addr.host, addr.port));
}
local.host = addr.host;
local.port = listener->Information->LocalPort;
@@ -1973,7 +1973,7 @@ IceInternal::doBind(SOCKET fd, const Address& addr)
}
else
{
- checkResultAndWait(datagram->BindEndpointAsync(addr.host, addr.port));
+ checkResultAndWait(datagram->BindEndpointAsync(addr.host, addr.port));
}
local.host = datagram->Information->LocalAddress;
local.port = datagram->Information->LocalPort;
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index a54fd179d95..72bfc604a15 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -129,8 +129,9 @@ IceInternal::UdpTransceiver::close()
#endif
assert(_fd != INVALID_SOCKET);
- closeSocket(_fd);
+ SOCKET fd = _fd;
_fd = INVALID_SOCKET;
+ closeSocket(fd);
}
EndpointIPtr