diff options
Diffstat (limited to 'cpp/src/Ice/EndpointFactoryManager.cpp')
-rw-r--r-- | cpp/src/Ice/EndpointFactoryManager.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cpp/src/Ice/EndpointFactoryManager.cpp b/cpp/src/Ice/EndpointFactoryManager.cpp index 8fa1e614769..a2105da4274 100644 --- a/cpp/src/Ice/EndpointFactoryManager.cpp +++ b/cpp/src/Ice/EndpointFactoryManager.cpp @@ -30,6 +30,15 @@ IceInternal::EndpointFactoryManager::EndpointFactoryManager(const InstancePtr& i } void +IceInternal::EndpointFactoryManager::initialize() const +{ + for(vector<EndpointFactoryPtr>::size_type i = 0; i < _factories.size(); i++) + { + _factories[i]->initialize(); + } +} + +void IceInternal::EndpointFactoryManager::add(const EndpointFactoryPtr& factory) { IceUtil::Mutex::Lock sync(*this); // TODO: Necessary? @@ -188,7 +197,13 @@ IceInternal::EndpointFactoryManager::read(InputStream* s) const { e = factory->read(s); } - else + // + // If the factory failed to read the endpoint, return an opaque endpoint. This can + // occur if for example the factory delegates to another factory and this factory + // isn't available. In this case, the factory needs to make sure the stream position + // is preserved for reading the opaque endpoint. + // + if(!e) { e = ICE_MAKE_SHARED(OpaqueEndpointI, type, s); } |