< Summary

Information
Class: Ice.Internal.Instance.ObserverUpdaterI
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/Internal/Instance.cs
Tag: 71_18251537082
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 1420
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Total methods: 3
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
updateConnectionObservers()100%11100%
updateThreadObservers()100%11100%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/Internal/Instance.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Diagnostics;
 4using System.Globalization;
 5using System.Text;
 6
 7namespace Ice.Internal;
 8
 9public sealed class BufSizeWarnInfo
 10{
 11    // Whether send size warning has been emitted
 12    public bool sndWarn;
 13
 14    // The send size for which the warning was emitted
 15    public int sndSize;
 16
 17    // Whether receive size warning has been emitted
 18    public bool rcvWarn;
 19
 20    // The receive size for which the warning was emitted
 21    public int rcvSize;
 22}
 23
 24public sealed class Instance
 25{
 26    private class ObserverUpdaterI : Ice.Instrumentation.ObserverUpdater
 27    {
 128        public ObserverUpdaterI(Instance instance) => _instance = instance;
 29
 130        public void updateConnectionObservers() => _instance.updateConnectionObservers();
 31
 132        public void updateThreadObservers() => _instance.updateThreadObservers();
 33
 34        private readonly Instance _instance;
 35    }
 36
 37    public Ice.InitializationData initializationData() =>
 38        //
 39        // No check for destruction. It must be possible to access the
 40        // initialization data after destruction.
 41        //
 42        // No mutex lock, immutable.
 43        //
 44        _initData;
 45
 46    public TraceLevels traceLevels()
 47    {
 48        // No mutex lock, immutable.
 49        Debug.Assert(_traceLevels != null);
 50        return _traceLevels;
 51    }
 52
 53    public DefaultsAndOverrides defaultsAndOverrides()
 54    {
 55        // No mutex lock, immutable.
 56        Debug.Assert(_defaultsAndOverrides != null);
 57        return _defaultsAndOverrides;
 58    }
 59
 60    public RouterManager routerManager()
 61    {
 62        lock (_mutex)
 63        {
 64            if (_state == StateDestroyed)
 65            {
 66                throw new Ice.CommunicatorDestroyedException();
 67            }
 68
 69            Debug.Assert(_routerManager != null);
 70            return _routerManager;
 71        }
 72    }
 73
 74    public LocatorManager locatorManager()
 75    {
 76        lock (_mutex)
 77        {
 78            if (_state == StateDestroyed)
 79            {
 80                throw new Ice.CommunicatorDestroyedException();
 81            }
 82
 83            Debug.Assert(_locatorManager != null);
 84            return _locatorManager;
 85        }
 86    }
 87
 88    internal ReferenceFactory referenceFactory()
 89    {
 90        lock (_mutex)
 91        {
 92            if (_state == StateDestroyed)
 93            {
 94                throw new Ice.CommunicatorDestroyedException();
 95            }
 96
 97            Debug.Assert(_referenceFactory != null);
 98            return _referenceFactory;
 99        }
 100    }
 101
 102    internal OutgoingConnectionFactory outgoingConnectionFactory()
 103    {
 104        lock (_mutex)
 105        {
 106            if (_state == StateDestroyed)
 107            {
 108                throw new Ice.CommunicatorDestroyedException();
 109            }
 110
 111            Debug.Assert(_outgoingConnectionFactory != null);
 112            return _outgoingConnectionFactory;
 113        }
 114    }
 115
 116    public ObjectAdapterFactory objectAdapterFactory()
 117    {
 118        lock (_mutex)
 119        {
 120            if (_state == StateDestroyed)
 121            {
 122                throw new Ice.CommunicatorDestroyedException();
 123            }
 124
 125            Debug.Assert(_objectAdapterFactory != null);
 126            return _objectAdapterFactory;
 127        }
 128    }
 129
 130    public int protocolSupport() => _protocolSupport;
 131
 132    public bool preferIPv6() => _preferIPv6;
 133
 134    public NetworkProxy networkProxy() => _networkProxy;
 135
 136    public ThreadPool clientThreadPool()
 137    {
 138        lock (_mutex)
 139        {
 140            if (_state == StateDestroyed)
 141            {
 142                throw new Ice.CommunicatorDestroyedException();
 143            }
 144
 145            Debug.Assert(_clientThreadPool != null);
 146            return _clientThreadPool;
 147        }
 148    }
 149
 150    public ThreadPool serverThreadPool()
 151    {
 152        lock (_mutex)
 153        {
 154            if (_state == StateDestroyed)
 155            {
 156                throw new Ice.CommunicatorDestroyedException();
 157            }
 158
 159            if (_serverThreadPool == null) // Lazy initialization.
 160            {
 161                if (_state == StateDestroyInProgress)
 162                {
 163                    throw new Ice.CommunicatorDestroyedException();
 164                }
 165                int timeout = _initData.properties.getIcePropertyAsInt("Ice.ServerIdleTime");
 166                _serverThreadPool = new ThreadPool(this, "Ice.ThreadPool.Server", timeout);
 167            }
 168
 169            return _serverThreadPool;
 170        }
 171    }
 172
 173    public EndpointHostResolver endpointHostResolver()
 174    {
 175        lock (_mutex)
 176        {
 177            if (_state == StateDestroyed)
 178            {
 179                throw new Ice.CommunicatorDestroyedException();
 180            }
 181
 182            Debug.Assert(_endpointHostResolver != null);
 183            return _endpointHostResolver;
 184        }
 185    }
 186
 187    public RetryQueue
 188    retryQueue()
 189    {
 190        lock (_mutex)
 191        {
 192            if (_state == StateDestroyed)
 193            {
 194                throw new Ice.CommunicatorDestroyedException();
 195            }
 196
 197            Debug.Assert(_retryQueue != null);
 198            return _retryQueue;
 199        }
 200    }
 201
 202    public Timer
 203    timer()
 204    {
 205        lock (_mutex)
 206        {
 207            if (_state == StateDestroyed)
 208            {
 209                throw new Ice.CommunicatorDestroyedException();
 210            }
 211
 212            Debug.Assert(_timer != null);
 213            return _timer;
 214        }
 215    }
 216
 217    public EndpointFactoryManager endpointFactoryManager()
 218    {
 219        lock (_mutex)
 220        {
 221            if (_state == StateDestroyed)
 222            {
 223                throw new Ice.CommunicatorDestroyedException();
 224            }
 225
 226            Debug.Assert(_endpointFactoryManager != null);
 227            return _endpointFactoryManager;
 228        }
 229    }
 230
 231    public Ice.PluginManager pluginManager()
 232    {
 233        lock (_mutex)
 234        {
 235            if (_state == StateDestroyed)
 236            {
 237                throw new Ice.CommunicatorDestroyedException();
 238            }
 239
 240            Debug.Assert(_pluginManager != null);
 241            return _pluginManager;
 242        }
 243    }
 244
 245    public int messageSizeMax() =>
 246        // No mutex lock, immutable.
 247        _messageSizeMax;
 248
 249    public int batchAutoFlushSize() =>
 250        // No mutex lock, immutable.
 251        _batchAutoFlushSize;
 252
 253    public int classGraphDepthMax() =>
 254        // No mutex lock, immutable.
 255        _classGraphDepthMax;
 256
 257    public Ice.ToStringMode
 258    toStringMode() =>
 259        // No mutex lock, immutable
 260        _toStringMode;
 261
 262    public int cacheMessageBuffers() =>
 263        // No mutex lock, immutable.
 264        _cacheMessageBuffers;
 265
 266    public Ice.ImplicitContextI getImplicitContext() => _implicitContext;
 267
 268    public Ice.ObjectPrx createAdmin(Ice.ObjectAdapter adminAdapter, Ice.Identity adminIdentity)
 269    {
 270        bool createAdapter = adminAdapter == null;
 271
 272        lock (_mutex)
 273        {
 274            if (_state == StateDestroyed)
 275            {
 276                throw new Ice.CommunicatorDestroyedException();
 277            }
 278
 279            if (adminIdentity == null || adminIdentity.name.Length == 0)
 280            {
 281                throw new ArgumentException("The admin identity is not valid", nameof(adminIdentity));
 282            }
 283
 284            if (_adminAdapter != null)
 285            {
 286                throw new Ice.InitializationException("Admin already created");
 287            }
 288
 289            if (!_adminEnabled)
 290            {
 291                throw new Ice.InitializationException("Admin is disabled");
 292            }
 293
 294            if (createAdapter)
 295            {
 296                if (_initData.properties.getIceProperty("Ice.Admin.Endpoints").Length > 0)
 297                {
 298                    adminAdapter = _objectAdapterFactory.createObjectAdapter(
 299                        "Ice.Admin",
 300                        router: null,
 301                        serverAuthenticationOptions: null);
 302                }
 303                else
 304                {
 305                    throw new Ice.InitializationException("Ice.Admin.Endpoints is not set");
 306                }
 307            }
 308
 309            _adminIdentity = adminIdentity;
 310            _adminAdapter = adminAdapter;
 311            addAllAdminFacets();
 312        }
 313
 314        if (createAdapter)
 315        {
 316            try
 317            {
 318                adminAdapter.activate();
 319            }
 320            catch (Ice.LocalException)
 321            {
 322                //
 323                // We cleanup _adminAdapter, however this error is not recoverable
 324                // (can't call again getAdmin() after fixing the problem)
 325                // since all the facets (servants) in the adapter are lost
 326                //
 327                adminAdapter.destroy();
 328                lock (_mutex)
 329                {
 330                    _adminAdapter = null;
 331                }
 332                throw;
 333            }
 334        }
 335        setServerProcessProxy(adminAdapter, adminIdentity);
 336        return adminAdapter.createProxy(adminIdentity);
 337    }
 338
 339    public Ice.ObjectPrx
 340    getAdmin()
 341    {
 342        Ice.ObjectAdapter adminAdapter;
 343        Ice.Identity adminIdentity;
 344
 345        lock (_mutex)
 346        {
 347            if (_state == StateDestroyed)
 348            {
 349                throw new Ice.CommunicatorDestroyedException();
 350            }
 351
 352            if (_adminAdapter != null)
 353            {
 354                return _adminAdapter.createProxy(_adminIdentity);
 355            }
 356            else if (_adminEnabled)
 357            {
 358                if (_initData.properties.getIceProperty("Ice.Admin.Endpoints").Length > 0)
 359                {
 360                    adminAdapter = _objectAdapterFactory.createObjectAdapter(
 361                        "Ice.Admin",
 362                        router: null,
 363                        serverAuthenticationOptions: null);
 364                }
 365                else
 366                {
 367                    return null;
 368                }
 369                adminIdentity = new Ice.Identity(
 370                    "admin",
 371                    _initData.properties.getIceProperty("Ice.Admin.InstanceName"));
 372                if (adminIdentity.category.Length == 0)
 373                {
 374                    adminIdentity.category = System.Guid.NewGuid().ToString();
 375                }
 376
 377                _adminIdentity = adminIdentity;
 378                _adminAdapter = adminAdapter;
 379                addAllAdminFacets();
 380                // continue below outside synchronization
 381            }
 382            else
 383            {
 384                return null;
 385            }
 386        }
 387
 388        try
 389        {
 390            adminAdapter.activate();
 391        }
 392        catch (Ice.LocalException)
 393        {
 394            //
 395            // We cleanup _adminAdapter, however this error is not recoverable
 396            // (can't call again getAdmin() after fixing the problem)
 397            // since all the facets (servants) in the adapter are lost
 398            //
 399            adminAdapter.destroy();
 400            lock (_mutex)
 401            {
 402                _adminAdapter = null;
 403            }
 404            throw;
 405        }
 406
 407        setServerProcessProxy(adminAdapter, adminIdentity);
 408        return adminAdapter.createProxy(adminIdentity);
 409    }
 410
 411    public void
 412    addAdminFacet(Ice.Object servant, string facet)
 413    {
 414        lock (_mutex)
 415        {
 416            if (_state == StateDestroyed)
 417            {
 418                throw new Ice.CommunicatorDestroyedException();
 419            }
 420
 421            if (_adminAdapter == null || (_adminFacetFilter.Count > 0 && !_adminFacetFilter.Contains(facet)))
 422            {
 423                if (_adminFacets.ContainsKey(facet))
 424                {
 425                    throw new Ice.AlreadyRegisteredException("facet", facet);
 426                }
 427                _adminFacets.Add(facet, servant);
 428            }
 429            else
 430            {
 431                _adminAdapter.addFacet(servant, _adminIdentity, facet);
 432            }
 433        }
 434    }
 435
 436    public Ice.Object
 437    removeAdminFacet(string facet)
 438    {
 439        lock (_mutex)
 440        {
 441            if (_state == StateDestroyed)
 442            {
 443                throw new Ice.CommunicatorDestroyedException();
 444            }
 445
 446            Ice.Object result = null;
 447            if (_adminAdapter == null || (_adminFacetFilter.Count > 0 && !_adminFacetFilter.Contains(facet)))
 448            {
 449                try
 450                {
 451                    result = _adminFacets[facet];
 452                }
 453                catch (KeyNotFoundException)
 454                {
 455                    throw new Ice.NotRegisteredException("facet", facet);
 456                }
 457
 458                _adminFacets.Remove(facet);
 459            }
 460            else
 461            {
 462                result = _adminAdapter.removeFacet(_adminIdentity, facet);
 463            }
 464            return result;
 465        }
 466    }
 467
 468    public Ice.Object
 469    findAdminFacet(string facet)
 470    {
 471        lock (_mutex)
 472        {
 473            if (_state == StateDestroyed)
 474            {
 475                throw new Ice.CommunicatorDestroyedException();
 476            }
 477
 478            Ice.Object result = null;
 479            if (_adminAdapter == null || (_adminFacetFilter.Count > 0 && !_adminFacetFilter.Contains(facet)))
 480            {
 481                try
 482                {
 483                    result = _adminFacets[facet];
 484                }
 485                catch (KeyNotFoundException)
 486                {
 487                }
 488            }
 489            else
 490            {
 491                result = _adminAdapter.findFacet(_adminIdentity, facet);
 492            }
 493            return result;
 494        }
 495    }
 496
 497    public Dictionary<string, Ice.Object>
 498    findAllAdminFacets()
 499    {
 500        lock (_mutex)
 501        {
 502            if (_state == StateDestroyed)
 503            {
 504                throw new Ice.CommunicatorDestroyedException();
 505            }
 506
 507            if (_adminAdapter == null)
 508            {
 509                return new Dictionary<string, Ice.Object>(_adminFacets);
 510            }
 511            else
 512            {
 513                Dictionary<string, Ice.Object> result = _adminAdapter.findAllFacets(_adminIdentity);
 514                if (_adminFacets.Count > 0)
 515                {
 516                    foreach (KeyValuePair<string, Ice.Object> p in _adminFacets)
 517                    {
 518                        result.Add(p.Key, p.Value);
 519                    }
 520                }
 521                return result;
 522            }
 523        }
 524    }
 525
 526    public void
 527    setDefaultLocator(Ice.LocatorPrx locator)
 528    {
 529        lock (_mutex)
 530        {
 531            if (_state == StateDestroyed)
 532            {
 533                throw new Ice.CommunicatorDestroyedException();
 534            }
 535
 536            _referenceFactory = _referenceFactory.setDefaultLocator(locator);
 537        }
 538    }
 539
 540    public void
 541    setDefaultRouter(Ice.RouterPrx router)
 542    {
 543        lock (_mutex)
 544        {
 545            if (_state == StateDestroyed)
 546            {
 547                throw new Ice.CommunicatorDestroyedException();
 548            }
 549
 550            _referenceFactory = _referenceFactory.setDefaultRouter(router);
 551        }
 552    }
 553
 554    public void
 555    setLogger(Ice.Logger logger) =>
 556        //
 557        // No locking, as it can only be called during plug-in loading
 558        //
 559        _initData.logger = logger;
 560
 561    public void
 562    setThreadHook(System.Action threadStart, System.Action threadStop)
 563    {
 564        //
 565        // No locking, as it can only be called during plug-in loading
 566        //
 567        _initData.threadStart = threadStart;
 568        _initData.threadStop = threadStop;
 569    }
 570
 571    internal void addSliceLoader(SliceLoader loader) => _applicationSliceLoader.add(loader);
 572
 573    //
 574    // Only for use by Ice.Communicator
 575    //
 576    internal void initialize(Ice.Communicator communicator, Ice.InitializationData initData)
 577    {
 578        _state = StateActive;
 579        _initData = initData;
 580
 581        try
 582        {
 583            _initData.properties ??= new Ice.Properties();
 584
 585            lock (_staticLock)
 586            {
 587                if (!_oneOffDone)
 588                {
 589                    string stdOut = _initData.properties.getIceProperty("Ice.StdOut");
 590                    string stdErr = _initData.properties.getIceProperty("Ice.StdErr");
 591
 592                    System.IO.StreamWriter outStream = null;
 593
 594                    if (stdOut.Length > 0)
 595                    {
 596                        try
 597                        {
 598                            outStream = System.IO.File.AppendText(stdOut);
 599                        }
 600                        catch (IOException ex)
 601                        {
 602                            throw new FileException($"Cannot append to '{stdOut}'", ex);
 603                        }
 604                        outStream.AutoFlush = true;
 605                        Console.Out.Close();
 606                        Console.SetOut(outStream);
 607                    }
 608                    if (stdErr.Length > 0)
 609                    {
 610                        if (stdErr.Equals(stdOut, StringComparison.Ordinal))
 611                        {
 612                            Console.SetError(outStream);
 613                        }
 614                        else
 615                        {
 616                            System.IO.StreamWriter errStream = null;
 617                            try
 618                            {
 619                                errStream = System.IO.File.AppendText(stdErr);
 620                            }
 621                            catch (IOException ex)
 622                            {
 623                                throw new FileException($"Cannot append to '{stdErr}'", ex);
 624                            }
 625                            errStream.AutoFlush = true;
 626                            Console.Error.Close();
 627                            Console.SetError(errStream);
 628                        }
 629                    }
 630
 631                    _oneOffDone = true;
 632                }
 633            }
 634
 635            if (_initData.logger == null)
 636            {
 637                string logfile = _initData.properties.getIceProperty("Ice.LogFile");
 638                if (logfile.Length != 0)
 639                {
 640                    _initData.logger =
 641                        new Ice.FileLoggerI(_initData.properties.getIceProperty("Ice.ProgramName"), logfile);
 642                }
 643                else if (Ice.Util.getProcessLogger() is Ice.LoggerI)
 644                {
 645                    //
 646                    // Ice.ConsoleListener is enabled by default.
 647                    //
 648                    bool console = _initData.properties.getIcePropertyAsInt("Ice.ConsoleListener") > 0;
 649                    _initData.logger =
 650                        new Ice.TraceLoggerI(_initData.properties.getIceProperty("Ice.ProgramName"), console);
 651                }
 652                else
 653                {
 654                    _initData.logger = Ice.Util.getProcessLogger();
 655                }
 656            }
 657
 658            _traceLevels = new TraceLevels(_initData.properties);
 659
 660            _defaultsAndOverrides = new DefaultsAndOverrides(_initData.properties, _initData.logger);
 661
 662            clientConnectionOptions = readConnectionOptions("Ice.Connection.Client");
 663            _serverConnectionOptions = readConnectionOptions("Ice.Connection.Server");
 664
 665            // The maximum size of an Ice protocol message in bytes. This is limited to 0x7fffffff, which corresponds to
 666            // the maximum value of a 32-bit signed integer (int).
 667            const int messageSizeMaxUpperLimit = int.MaxValue;
 668            int messageSizeMax = _initData.properties.getIcePropertyAsInt("Ice.MessageSizeMax");
 669            if (messageSizeMax > messageSizeMaxUpperLimit / 1024)
 670            {
 671                throw new Ice.InitializationException(
 672                    $"Ice.MessageSizeMax '{messageSizeMax}' is too large, it must be less than or equal to '{messageSize
 673            }
 674            else if (messageSizeMax < 1)
 675            {
 676                _messageSizeMax = messageSizeMaxUpperLimit;
 677            }
 678            else
 679            {
 680                // The property is specified in kibibytes (KiB); _messageSizeMax is stored in bytes.
 681                _messageSizeMax = messageSizeMax * 1024;
 682            }
 683
 684            int batchAutoFlushSize = _initData.properties.getIcePropertyAsInt("Ice.BatchAutoFlushSize");
 685            if (batchAutoFlushSize > messageSizeMaxUpperLimit / 1024)
 686            {
 687                throw new Ice.InitializationException(
 688                    $"Ice.BatchAutoFlushSize '{batchAutoFlushSize}' is too large, it must be less than or equal to '{mes
 689            }
 690            else if (batchAutoFlushSize < 1)
 691            {
 692                _batchAutoFlushSize = messageSizeMaxUpperLimit;
 693            }
 694            else
 695            {
 696                // The property is specified in kibibytes (KiB); _batchAutoFlushSize is stored in bytes.
 697                _batchAutoFlushSize = batchAutoFlushSize * 1024;
 698            }
 699
 700            int classGraphDepthMax = _initData.properties.getIcePropertyAsInt("Ice.ClassGraphDepthMax");
 701            if (classGraphDepthMax < 1)
 702            {
 703                _classGraphDepthMax = 0x7fffffff;
 704            }
 705            else
 706            {
 707                _classGraphDepthMax = classGraphDepthMax;
 708            }
 709
 710            // Update _initData.sliceLoader
 711
 712            if (_initData.sliceLoader is not null)
 713            {
 714                _applicationSliceLoader.add(_initData.sliceLoader);
 715            }
 716
 717            // We create a lazy Slice loader that searches assemblies the first time we unmarshal a class or
 718            // exception. At that time, all the assemblies should have been loaded.
 719            var lazySliceLoader = new LazySliceLoader(
 720                () => SliceLoader.fromAssemblies(AppDomain.CurrentDomain.GetAssemblies()));
 721
 722            _initData.sliceLoader = new CompositeSliceLoader(_applicationSliceLoader, lazySliceLoader);
 723
 724            string toStringModeStr = _initData.properties.getIceProperty("Ice.ToStringMode");
 725            if (toStringModeStr == "Unicode")
 726            {
 727                _toStringMode = Ice.ToStringMode.Unicode;
 728            }
 729            else if (toStringModeStr == "ASCII")
 730            {
 731                _toStringMode = Ice.ToStringMode.ASCII;
 732            }
 733            else if (toStringModeStr == "Compat")
 734            {
 735                _toStringMode = Ice.ToStringMode.Compat;
 736            }
 737            else
 738            {
 739                throw new Ice.InitializationException(
 740                    "The value for Ice.ToStringMode must be Unicode, ASCII or Compat");
 741            }
 742
 743            _cacheMessageBuffers = _initData.properties.getIcePropertyAsInt("Ice.CacheMessageBuffers");
 744
 745            _implicitContext = Ice.ImplicitContextI.create(_initData.properties.getIceProperty("Ice.ImplicitContext"));
 746            _routerManager = new RouterManager();
 747
 748            _locatorManager = new LocatorManager(_initData.properties);
 749
 750            _referenceFactory = new ReferenceFactory(this, communicator);
 751
 752            bool isIPv6Supported = Network.isIPv6Supported();
 753            bool ipv4 = _initData.properties.getIcePropertyAsInt("Ice.IPv4") > 0;
 754            bool ipv6 = isIPv6Supported && _initData.properties.getIcePropertyAsInt("Ice.IPv6") > 0;
 755            if (!ipv4 && !ipv6)
 756            {
 757                throw new Ice.InitializationException("Both IPV4 and IPv6 support cannot be disabled.");
 758            }
 759            else if (ipv4 && ipv6)
 760            {
 761                _protocolSupport = Network.EnableBoth;
 762            }
 763            else if (ipv4)
 764            {
 765                _protocolSupport = Network.EnableIPv4;
 766            }
 767            else
 768            {
 769                _protocolSupport = Network.EnableIPv6;
 770            }
 771            _preferIPv6 = _initData.properties.getIcePropertyAsInt("Ice.PreferIPv6Address") > 0;
 772
 773            _networkProxy = createNetworkProxy(_initData.properties, _protocolSupport);
 774
 775            _sslEngine = new Ice.SSL.SSLEngine(communicator);
 776
 777            _endpointFactoryManager = new EndpointFactoryManager(this);
 778
 779            var tcpInstance = new ProtocolInstance(this, Ice.TCPEndpointType.value, "tcp", false);
 780            _endpointFactoryManager.add(new TcpEndpointFactory(tcpInstance));
 781
 782            var udpInstance = new ProtocolInstance(this, Ice.UDPEndpointType.value, "udp", false);
 783            _endpointFactoryManager.add(new UdpEndpointFactory(udpInstance));
 784
 785            var wsInstance = new ProtocolInstance(this, Ice.WSEndpointType.value, "ws", false);
 786            _endpointFactoryManager.add(new WSEndpointFactory(wsInstance, Ice.TCPEndpointType.value));
 787
 788            var sslInstance = new Ice.SSL.Instance(_sslEngine, Ice.SSLEndpointType.value, "ssl");
 789            _endpointFactoryManager.add(new Ice.SSL.EndpointFactoryI(sslInstance, Ice.TCPEndpointType.value));
 790
 791            var wssInstance = new ProtocolInstance(this, Ice.WSSEndpointType.value, "wss", true);
 792            _endpointFactoryManager.add(new WSEndpointFactory(wssInstance, Ice.SSLEndpointType.value));
 793
 794            _pluginManager = new Ice.PluginManagerI(communicator);
 795
 796            _outgoingConnectionFactory = new OutgoingConnectionFactory(this);
 797
 798            _objectAdapterFactory = new ObjectAdapterFactory(this, communicator);
 799
 800            _retryQueue = new RetryQueue(this);
 801
 802            string[] retryValues = _initData.properties.getIcePropertyAsList("Ice.RetryIntervals");
 803            if (retryValues.Length == 0)
 804            {
 805                retryIntervals = [0];
 806            }
 807            else
 808            {
 809                retryIntervals = new int[retryValues.Length];
 810
 811                for (int i = 0; i < retryValues.Length; i++)
 812                {
 813                    int v;
 814
 815                    try
 816                    {
 817                        v = int.Parse(retryValues[i], CultureInfo.InvariantCulture);
 818                    }
 819                    catch (System.FormatException)
 820                    {
 821                        v = 0;
 822                    }
 823
 824                    //
 825                    // If -1 is the first value, no retry and wait intervals.
 826                    //
 827                    if (i == 0 && v == -1)
 828                    {
 829                        retryIntervals = [];
 830                        break;
 831                    }
 832
 833                    retryIntervals[i] = v > 0 ? v : 0;
 834                }
 835            }
 836
 837            if (_initData.properties.getIcePropertyAsInt("Ice.PreloadAssemblies") > 0)
 838            {
 839                AssemblyUtil.preloadAssemblies();
 840            }
 841        }
 842        catch (Ice.LocalException)
 843        {
 844            destroy();
 845            throw;
 846        }
 847    }
 848
 849    internal void finishSetup(Communicator communicator)
 850    {
 851        //
 852        // Load plug-ins.
 853        //
 854        Debug.Assert(_serverThreadPool == null);
 855        var pluginManagerImpl = (Ice.PluginManagerI)_pluginManager;
 856        pluginManagerImpl.loadPlugins();
 857
 858        //
 859        // Initialize the endpoint factories once all the plugins are loaded. This gives
 860        // the opportunity for the endpoint factories to find underlying factories.
 861        //
 862        _endpointFactoryManager.initialize();
 863
 864        //
 865        // Create Admin facets, if enabled.
 866        //
 867        // Note that any logger-dependent admin facet must be created after we load all plugins,
 868        // since one of these plugins can be a Logger plugin that sets a new logger during loading
 869        //
 870
 871        if (_initData.properties.getIceProperty("Ice.Admin.Enabled").Length == 0)
 872        {
 873            _adminEnabled = _initData.properties.getIceProperty("Ice.Admin.Endpoints").Length > 0;
 874        }
 875        else
 876        {
 877            _adminEnabled = _initData.properties.getIcePropertyAsInt("Ice.Admin.Enabled") > 0;
 878        }
 879
 880        string[] facetFilter = _initData.properties.getIcePropertyAsList("Ice.Admin.Facets");
 881        if (facetFilter.Length > 0)
 882        {
 883            foreach (string s in facetFilter)
 884            {
 885                _adminFacetFilter.Add(s);
 886            }
 887        }
 888
 889        if (_adminEnabled)
 890        {
 891            //
 892            // Process facet
 893            //
 894            string processFacetName = "Process";
 895            if (_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(processFacetName))
 896            {
 897                _adminFacets.Add(processFacetName, new ProcessI(communicator));
 898            }
 899
 900            //
 901            // Logger facet
 902            //
 903            string loggerFacetName = "Logger";
 904            if (_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(loggerFacetName))
 905            {
 906                LoggerAdminLogger logger = new LoggerAdminLoggerI(_initData.properties, _initData.logger);
 907                setLogger(logger);
 908                _adminFacets.Add(loggerFacetName, logger.getFacet());
 909            }
 910
 911            //
 912            // Properties facet
 913            //
 914            string propertiesFacetName = "Properties";
 915            NativePropertiesAdmin propsAdmin = null;
 916            if (_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(propertiesFacetName))
 917            {
 918                propsAdmin = new NativePropertiesAdmin(this);
 919                _adminFacets.Add(propertiesFacetName, propsAdmin);
 920            }
 921
 922            //
 923            // Metrics facet
 924            //
 925            string metricsFacetName = "Metrics";
 926            if (_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(metricsFacetName))
 927            {
 928                var observer = new CommunicatorObserverI(_initData);
 929                _initData.observer = observer;
 930                _adminFacets.Add(metricsFacetName, observer.getFacet());
 931
 932                //
 933                // Make sure the admin plugin receives property updates.
 934                //
 935                propsAdmin?.addUpdateCallback(observer.getFacet().updated);
 936            }
 937        }
 938
 939        //
 940        // Set observer updater
 941        //
 942        _initData.observer?.setObserverUpdater(new ObserverUpdaterI(this));
 943
 944        //
 945        // Create threads.
 946        //
 947        try
 948        {
 949            _timer = new Timer(this, Util.stringToThreadPriority(
 950                                            initializationData().properties.getIceProperty("Ice.ThreadPriority")));
 951        }
 952        catch (System.Exception ex)
 953        {
 954            string s = "cannot create thread for timer:\n" + ex;
 955            _initData.logger.error(s);
 956            throw;
 957        }
 958
 959        try
 960        {
 961            _endpointHostResolver = new EndpointHostResolver(this);
 962        }
 963        catch (System.Exception ex)
 964        {
 965            string s = "cannot create thread for endpoint host resolver:\n" + ex;
 966            _initData.logger.error(s);
 967            throw;
 968        }
 969        _clientThreadPool = new ThreadPool(this, "Ice.ThreadPool.Client", 0);
 970
 971        //
 972        // The default router/locator may have been set during the loading of plugins.
 973        // Therefore we make sure it is not already set before checking the property.
 974        //
 975        if (_referenceFactory.getDefaultRouter() == null)
 976        {
 977            Ice.RouterPrx r = Ice.RouterPrxHelper.uncheckedCast(
 978                communicator.propertyToProxy("Ice.Default.Router"));
 979            if (r != null)
 980            {
 981                _referenceFactory = _referenceFactory.setDefaultRouter(r);
 982            }
 983        }
 984
 985        if (_referenceFactory.getDefaultLocator() == null)
 986        {
 987            Ice.LocatorPrx l = Ice.LocatorPrxHelper.uncheckedCast(
 988                communicator.propertyToProxy("Ice.Default.Locator"));
 989            if (l != null)
 990            {
 991                _referenceFactory = _referenceFactory.setDefaultLocator(l);
 992            }
 993        }
 994
 995        //
 996        // Show process id if requested (but only once).
 997        //
 998        lock (_mutex)
 999        {
 1000            if (!_printProcessIdDone && _initData.properties.getIcePropertyAsInt("Ice.PrintProcessId") > 0)
 1001            {
 1002                using var p = System.Diagnostics.Process.GetCurrentProcess();
 1003                Console.WriteLine(p.Id);
 1004                _printProcessIdDone = true;
 1005            }
 1006        }
 1007
 1008        // SslEngine initialization
 1009        _sslEngine.initialize();
 1010
 1011        //
 1012        // Server thread pool initialization is lazy in serverThreadPool().
 1013        //
 1014
 1015        //
 1016        // An application can set Ice.InitPlugins=0 if it wants to postpone
 1017        // initialization until after it has interacted directly with the
 1018        // plug-ins.
 1019        //
 1020        if (_initData.properties.getIcePropertyAsInt("Ice.InitPlugins") > 0)
 1021        {
 1022            pluginManagerImpl.initializePlugins();
 1023        }
 1024
 1025        //
 1026        // This must be done last as this call creates the Ice.Admin object adapter
 1027        // and eventually registers a process proxy with the Ice locator (allowing
 1028        // remote clients to invoke on Ice.Admin facets as soon as it's registered).
 1029        //
 1030        if (_initData.properties.getIcePropertyAsInt("Ice.Admin.DelayCreation") <= 0)
 1031        {
 1032            getAdmin();
 1033        }
 1034    }
 1035
 1036    //
 1037    // Only for use by Ice.Communicator
 1038    //
 1039    public void destroy()
 1040    {
 1041        lock (_mutex)
 1042        {
 1043            //
 1044            // If destroy is in progress, wait for it to be done. This
 1045            // is necessary in case destroy() is called concurrently
 1046            // by multiple threads.
 1047            //
 1048            while (_state == StateDestroyInProgress)
 1049            {
 1050                Monitor.Wait(_mutex);
 1051            }
 1052
 1053            if (_state == StateDestroyed)
 1054            {
 1055                return;
 1056            }
 1057            _state = StateDestroyInProgress;
 1058        }
 1059
 1060        //
 1061        // Shutdown and destroy all the incoming and outgoing Ice
 1062        // connections and wait for the connections to be finished.
 1063        //
 1064        _objectAdapterFactory?.shutdown();
 1065
 1066        _outgoingConnectionFactory?.destroy();
 1067
 1068        _objectAdapterFactory?.destroy();
 1069
 1070        _outgoingConnectionFactory?.waitUntilFinished();
 1071
 1072        _retryQueue?.destroy(); // Must be called before destroying thread pools.
 1073
 1074        _initData.observer?.setObserverUpdater(null);
 1075
 1076        if (_initData.logger is LoggerAdminLogger loggerAdminLogger)
 1077        {
 1078            loggerAdminLogger.destroy();
 1079        }
 1080
 1081        //
 1082        // Now, destroy the thread pools. This must be done *only* after
 1083        // all the connections are finished (the connections destruction
 1084        // can require invoking callbacks with the thread pools).
 1085        //
 1086        _serverThreadPool?.destroy();
 1087        _clientThreadPool?.destroy();
 1088        _endpointHostResolver?.destroy();
 1089
 1090        //
 1091        // Wait for all the threads to be finished.
 1092        //
 1093        _timer?.destroy();
 1094        _clientThreadPool?.joinWithAllThreads();
 1095        _serverThreadPool?.joinWithAllThreads();
 1096        _endpointHostResolver?.joinWithThread();
 1097
 1098        _routerManager?.destroy();
 1099
 1100        _locatorManager?.destroy();
 1101
 1102        if (_initData.properties.getIcePropertyAsInt("Ice.Warn.UnusedProperties") > 0)
 1103        {
 1104            List<string> unusedProperties = _initData.properties.getUnusedProperties();
 1105            if (unusedProperties.Count != 0)
 1106            {
 1107                var message = new StringBuilder("The following properties were set but never read:");
 1108                foreach (string s in unusedProperties)
 1109                {
 1110                    message.Append("\n    ");
 1111                    message.Append(s);
 1112                }
 1113                _initData.logger.warning(message.ToString());
 1114            }
 1115        }
 1116
 1117        //
 1118        // Destroy last so that a Logger plugin can receive all log/traces before its destruction.
 1119        //
 1120        _pluginManager?.destroy();
 1121
 1122        lock (_mutex)
 1123        {
 1124            _objectAdapterFactory = null;
 1125            _outgoingConnectionFactory = null;
 1126            _retryQueue = null;
 1127
 1128            _serverThreadPool = null;
 1129            _clientThreadPool = null;
 1130            _endpointHostResolver = null;
 1131            _timer = null;
 1132
 1133            _referenceFactory = null;
 1134            _routerManager = null;
 1135            _locatorManager = null;
 1136            _endpointFactoryManager = null;
 1137            _pluginManager = null;
 1138
 1139            _adminAdapter = null;
 1140            _adminFacets.Clear();
 1141
 1142            _state = StateDestroyed;
 1143            Monitor.PulseAll(_mutex);
 1144        }
 1145
 1146        if (_initData.logger is FileLoggerI fileLogger)
 1147        {
 1148            fileLogger.destroy();
 1149        }
 1150    }
 1151
 1152    public BufSizeWarnInfo getBufSizeWarn(short type)
 1153    {
 1154        lock (_setBufSizeWarn)
 1155        {
 1156            BufSizeWarnInfo info;
 1157            if (!_setBufSizeWarn.TryGetValue(type, out BufSizeWarnInfo value))
 1158            {
 1159                info = new BufSizeWarnInfo();
 1160                info.sndWarn = false;
 1161                info.sndSize = -1;
 1162                info.rcvWarn = false;
 1163                info.rcvSize = -1;
 1164                _setBufSizeWarn.Add(type, info);
 1165            }
 1166            else
 1167            {
 1168                info = _setBufSizeWarn[type];
 1169            }
 1170            return info;
 1171        }
 1172    }
 1173
 1174    public void setSndBufSizeWarn(short type, int size)
 1175    {
 1176        lock (_setBufSizeWarn)
 1177        {
 1178            BufSizeWarnInfo info = getBufSizeWarn(type);
 1179            info.sndWarn = true;
 1180            info.sndSize = size;
 1181            _setBufSizeWarn[type] = info;
 1182        }
 1183    }
 1184
 1185    public void setRcvBufSizeWarn(short type, int size)
 1186    {
 1187        lock (_setBufSizeWarn)
 1188        {
 1189            BufSizeWarnInfo info = getBufSizeWarn(type);
 1190            info.rcvWarn = true;
 1191            info.rcvSize = size;
 1192            _setBufSizeWarn[type] = info;
 1193        }
 1194    }
 1195
 1196    internal void updateConnectionObservers()
 1197    {
 1198        try
 1199        {
 1200            Debug.Assert(_outgoingConnectionFactory != null);
 1201            _outgoingConnectionFactory.updateConnectionObservers();
 1202            Debug.Assert(_objectAdapterFactory != null);
 1203            _objectAdapterFactory.updateConnectionObservers();
 1204        }
 1205        catch (Ice.CommunicatorDestroyedException)
 1206        {
 1207        }
 1208    }
 1209
 1210    internal void updateThreadObservers()
 1211    {
 1212        try
 1213        {
 1214            _clientThreadPool?.updateObservers();
 1215            _serverThreadPool?.updateObservers();
 1216            Debug.Assert(_objectAdapterFactory != null);
 1217            _objectAdapterFactory.updateThreadObservers();
 1218            _endpointHostResolver?.updateObserver();
 1219            _timer?.updateObserver(_initData.observer);
 1220        }
 1221        catch (Ice.CommunicatorDestroyedException)
 1222        {
 1223        }
 1224    }
 1225
 1226    internal void addAllAdminFacets()
 1227    {
 1228        lock (_mutex)
 1229        {
 1230            var filteredFacets = new Dictionary<string, Ice.Object>();
 1231
 1232            foreach (KeyValuePair<string, Ice.Object> entry in _adminFacets)
 1233            {
 1234                if (_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(entry.Key))
 1235                {
 1236                    _adminAdapter.addFacet(entry.Value, _adminIdentity, entry.Key);
 1237                }
 1238                else
 1239                {
 1240                    filteredFacets.Add(entry.Key, entry.Value);
 1241                }
 1242            }
 1243            _adminFacets = filteredFacets;
 1244        }
 1245    }
 1246
 1247    internal void setServerProcessProxy(Ice.ObjectAdapter adminAdapter, Ice.Identity adminIdentity)
 1248    {
 1249        Ice.ObjectPrx admin = adminAdapter.createProxy(adminIdentity);
 1250        Ice.LocatorPrx locator = adminAdapter.getLocator();
 1251        string serverId = _initData.properties.getIceProperty("Ice.Admin.ServerId");
 1252
 1253        if (locator != null && serverId.Length > 0)
 1254        {
 1255            Ice.ProcessPrx process = Ice.ProcessPrxHelper.uncheckedCast(admin.ice_facet("Process"));
 1256            try
 1257            {
 1258                //
 1259                // Note that as soon as the process proxy is registered, the communicator might be
 1260                // shutdown by a remote client and admin facets might start receiving calls.
 1261                //
 1262                locator.getRegistry().setServerProcessProxy(serverId, process);
 1263            }
 1264            catch (Ice.ServerNotFoundException)
 1265            {
 1266                if (_traceLevels.location >= 1)
 1267                {
 1268                    var s = new System.Text.StringBuilder();
 1269                    s.Append("couldn't register server `" + serverId + "' with the locator registry:\n");
 1270                    s.Append("the server is not known to the locator registry");
 1271                    _initData.logger.trace(_traceLevels.locationCat, s.ToString());
 1272                }
 1273
 1274                throw new Ice.InitializationException("Locator knows nothing about server `" + serverId + "'");
 1275            }
 1276            catch (Ice.LocalException ex)
 1277            {
 1278                if (_traceLevels.location >= 1)
 1279                {
 1280                    var s = new System.Text.StringBuilder();
 1281                    s.Append("couldn't register server `" + serverId + "' with the locator registry:\n" + ex);
 1282                    _initData.logger.trace(_traceLevels.locationCat, s.ToString());
 1283                }
 1284                throw; // TODO: Shall we raise a special exception instead of a non obvious local exception?
 1285            }
 1286
 1287            if (_traceLevels.location >= 1)
 1288            {
 1289                var s = new System.Text.StringBuilder();
 1290                s.Append("registered server `" + serverId + "' with the locator registry");
 1291                _initData.logger.trace(_traceLevels.locationCat, s.ToString());
 1292            }
 1293        }
 1294    }
 1295
 1296    internal ConnectionOptions serverConnectionOptions(string adapterName)
 1297    {
 1298        Debug.Assert(adapterName.Length > 0);
 1299        Properties properties = _initData.properties;
 1300        string propertyPrefix = $"{adapterName}.Connection";
 1301
 1302        return new(
 1303            connectTimeout: TimeSpan.FromSeconds(properties.getPropertyAsIntWithDefault(
 1304                $"{propertyPrefix}.ConnectTimeout",
 1305                (int)_serverConnectionOptions.connectTimeout.TotalSeconds)),
 1306
 1307            closeTimeout: TimeSpan.FromSeconds(properties.getPropertyAsIntWithDefault(
 1308                $"{propertyPrefix}.CloseTimeout",
 1309                (int)_serverConnectionOptions.closeTimeout.TotalSeconds)),
 1310
 1311            idleTimeout: TimeSpan.FromSeconds(properties.getPropertyAsIntWithDefault(
 1312                $"{propertyPrefix}.IdleTimeout",
 1313                (int)_serverConnectionOptions.idleTimeout.TotalSeconds)),
 1314
 1315            enableIdleCheck: properties.getPropertyAsIntWithDefault(
 1316                $"{propertyPrefix}.EnableIdleCheck",
 1317                _serverConnectionOptions.enableIdleCheck ? 1 : 0) > 0,
 1318
 1319            inactivityTimeout: TimeSpan.FromSeconds(properties.getPropertyAsIntWithDefault(
 1320                $"{propertyPrefix}.InactivityTimeout",
 1321                (int)_serverConnectionOptions.inactivityTimeout.TotalSeconds)),
 1322
 1323            maxDispatches: properties.getPropertyAsIntWithDefault(
 1324                $"{propertyPrefix}.MaxDispatches",
 1325                _serverConnectionOptions.maxDispatches));
 1326    }
 1327
 1328    internal SliceLoader sliceLoader => _initData.sliceLoader; // set in initialize
 1329
 1330    internal ConnectionOptions clientConnectionOptions { get; private set; } = null!; // set in initialize
 1331
 1332    internal int[] retryIntervals { get; private set; }
 1333
 1334    private NetworkProxy createNetworkProxy(Ice.Properties props, int protocolSupport)
 1335    {
 1336        string proxyHost;
 1337
 1338        proxyHost = props.getIceProperty("Ice.SOCKSProxyHost");
 1339        if (proxyHost.Length > 0)
 1340        {
 1341            if (protocolSupport == Network.EnableIPv6)
 1342            {
 1343                throw new Ice.InitializationException("IPv6 only is not supported with SOCKS4 proxies");
 1344            }
 1345            int proxyPort = props.getIcePropertyAsInt("Ice.SOCKSProxyPort");
 1346            return new SOCKSNetworkProxy(proxyHost, proxyPort);
 1347        }
 1348
 1349        proxyHost = props.getIceProperty("Ice.HTTPProxyHost");
 1350        if (proxyHost.Length > 0)
 1351        {
 1352            return new HTTPNetworkProxy(proxyHost, props.getIcePropertyAsInt("Ice.HTTPProxyPort"));
 1353        }
 1354
 1355        return null;
 1356    }
 1357
 1358    private ConnectionOptions readConnectionOptions(string propertyPrefix)
 1359    {
 1360        Properties properties = _initData.properties;
 1361
 1362        // The TimeSpan value can be <= 0. In this case, the timeout is considered infinite.
 1363        return new(
 1364            connectTimeout: TimeSpan.FromSeconds(properties.getIcePropertyAsInt($"{propertyPrefix}.ConnectTimeout")),
 1365            closeTimeout: TimeSpan.FromSeconds(properties.getIcePropertyAsInt($"{propertyPrefix}.CloseTimeout")),
 1366            idleTimeout: TimeSpan.FromSeconds(properties.getIcePropertyAsInt($"{propertyPrefix}.IdleTimeout")),
 1367            enableIdleCheck: properties.getIcePropertyAsInt($"{propertyPrefix}.EnableIdleCheck") > 0,
 1368            inactivityTimeout:
 1369                TimeSpan.FromSeconds(properties.getIcePropertyAsInt($"{propertyPrefix}.InactivityTimeout")),
 1370            maxDispatches: properties.getIcePropertyAsInt($"{propertyPrefix}.MaxDispatches"));
 1371    }
 1372
 1373    private static bool _printProcessIdDone;
 1374    private static bool _oneOffDone;
 1375    private static readonly object _staticLock = new object();
 1376
 1377    private const int StateActive = 0;
 1378    private const int StateDestroyInProgress = 1;
 1379    private const int StateDestroyed = 2;
 1380
 1381    private int _state;
 1382    private Ice.InitializationData _initData; // Immutable, not reset by destroy().
 1383    private TraceLevels _traceLevels; // Immutable, not reset by destroy().
 1384    private DefaultsAndOverrides _defaultsAndOverrides; // Immutable, not reset by destroy().
 1385    private int _messageSizeMax; // Immutable, not reset by destroy().
 1386    private int _batchAutoFlushSize; // Immutable, not reset by destroy().
 1387    private int _classGraphDepthMax; // Immutable, not reset by destroy().
 1388    private Ice.ToStringMode _toStringMode; // Immutable, not reset by destroy().
 1389    private int _cacheMessageBuffers; // Immutable, not reset by destroy().
 1390    private Ice.ImplicitContextI _implicitContext; // Immutable
 1391    private RouterManager _routerManager;
 1392    private LocatorManager _locatorManager;
 1393    private ReferenceFactory _referenceFactory;
 1394    private OutgoingConnectionFactory _outgoingConnectionFactory;
 1395    private ObjectAdapterFactory _objectAdapterFactory;
 1396    private int _protocolSupport;
 1397    private bool _preferIPv6;
 1398    private NetworkProxy _networkProxy;
 1399    private ThreadPool _clientThreadPool;
 1400    private ThreadPool _serverThreadPool;
 1401    private EndpointHostResolver _endpointHostResolver;
 1402    private Timer _timer;
 1403    private RetryQueue _retryQueue;
 1404    private EndpointFactoryManager _endpointFactoryManager;
 1405    private Ice.PluginManager _pluginManager;
 1406    private bool _adminEnabled;
 1407    private Ice.ObjectAdapter _adminAdapter;
 1408    private Dictionary<string, Ice.Object> _adminFacets = new();
 1409    private readonly HashSet<string> _adminFacetFilter = new();
 1410    private Ice.Identity _adminIdentity;
 1411    private readonly Dictionary<short, BufSizeWarnInfo> _setBufSizeWarn = new();
 1412    private ConnectionOptions _serverConnectionOptions; // set in initialize
 1413    private Ice.SSL.SSLEngine _sslEngine;
 1414
 1415    // The Slice loader(s) added by the application: initData.sliceLoader followed by the loaders added by
 1416    // addSliceLoader.
 1417    private readonly CompositeSliceLoader _applicationSliceLoader = new();
 1418
 1419    private readonly object _mutex = new object();
 1420}