diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-04-27 13:05:25 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-04-27 13:05:25 +0200 |
commit | c5ee6fd5310199110dae6b2d01decbd20174d8db (patch) | |
tree | daf558482821eb3a1ffd496b06ba8bcc2edce841 /csharp/src/Ice/EndpointFactoryManager.cs | |
parent | Extra whitespace (diff) | |
download | ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.bz2 ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.xz ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.zip |
Fixed ICE-6680 - WS transports are now provided by a separate IceWS plugin
Diffstat (limited to 'csharp/src/Ice/EndpointFactoryManager.cs')
-rw-r--r-- | csharp/src/Ice/EndpointFactoryManager.cs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/csharp/src/Ice/EndpointFactoryManager.cs b/csharp/src/Ice/EndpointFactoryManager.cs index 7dc55c990b5..73c31e557aa 100644 --- a/csharp/src/Ice/EndpointFactoryManager.cs +++ b/csharp/src/Ice/EndpointFactoryManager.cs @@ -20,13 +20,20 @@ namespace IceInternal _factories = new List<EndpointFactory>(); } + public void initialize() + { + foreach(EndpointFactory f in _factories) + { + f.initialize(); + } + } + public void add(EndpointFactory factory) { lock(this) { - for(int i = 0; i < _factories.Count; i++) + foreach(EndpointFactory f in _factories) { - EndpointFactory f = _factories[i]; if(f.type() == factory.type()) { Debug.Assert(false); @@ -40,9 +47,8 @@ namespace IceInternal { lock(this) { - for(int i = 0; i < _factories.Count; i++) + foreach(EndpointFactory f in _factories) { - EndpointFactory f = _factories[i]; if(f.type() == type) { return f; @@ -173,7 +179,13 @@ namespace IceInternal { 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 == null) { e = new OpaqueEndpointI(type, s); } @@ -186,9 +198,8 @@ namespace IceInternal internal void destroy() { - for(int i = 0; i < _factories.Count; i++) + foreach(EndpointFactory f in _factories) { - EndpointFactory f = (EndpointFactory)_factories[i]; f.destroy(); } _factories.Clear(); |