summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/TcpAcceptor.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-05-21 17:11:04 +0800
committerMatthew Newhook <matthew@zeroc.com>2008-05-21 17:11:04 +0800
commit06e20672108324fa9c2bc688aa9cfca1a586b200 (patch)
tree6bf6164f18dc7f20c638824e965d12aaab57dbf6 /cpp/src/Ice/TcpAcceptor.cpp
parenthttp://bugzilla/bugzilla/show_bug.cgi?id=3216 - mcastServer not initialized. (diff)
downloadice-06e20672108324fa9c2bc688aa9cfca1a586b200.tar.bz2
ice-06e20672108324fa9c2bc688aa9cfca1a586b200.tar.xz
ice-06e20672108324fa9c2bc688aa9cfca1a586b200.zip
Some cleanup of the networking code.
Diffstat (limited to 'cpp/src/Ice/TcpAcceptor.cpp')
-rw-r--r--cpp/src/Ice/TcpAcceptor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp
index aab7a740320..18d99100182 100644
--- a/cpp/src/Ice/TcpAcceptor.cpp
+++ b/cpp/src/Ice/TcpAcceptor.cpp
@@ -91,7 +91,8 @@ IceInternal::TcpAcceptor::effectivePort() const
IceInternal::TcpAcceptor::TcpAcceptor(const InstancePtr& instance, const string& host, int port) :
_instance(instance),
_traceLevels(instance->traceLevels()),
- _logger(instance->initializationData().logger)
+ _logger(instance->initializationData().logger),
+ _addr(getAddressForServer(host, port, instance->protocolSupport()))
{
#ifdef SOMAXCONN
_backlog = instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.TCP.Backlog", SOMAXCONN);
@@ -101,7 +102,6 @@ IceInternal::TcpAcceptor::TcpAcceptor(const InstancePtr& instance, const string&
try
{
- getAddressForServer(host, port, _addr, _instance->protocolSupport());
_fd = createSocket(false, _addr.ss_family);
setBlock(_fd, false);
setTcpBufSize(_fd, _instance->initializationData().properties, _logger);
@@ -125,7 +125,7 @@ IceInternal::TcpAcceptor::TcpAcceptor(const InstancePtr& instance, const string&
Trace out(_logger, _traceLevels->networkCat);
out << "attempting to bind to tcp socket " << toString();
}
- doBind(_fd, _addr);
+ doBind(_fd, const_cast<struct sockaddr_storage&>(_addr));
}
catch(...)
{