public void TestToAddress()
        {
            var publisherAvailability = new PublisherAvailability("test-dir", "1.2.3.4", 111);

            Assert.Equal(Address.From(Host.Of("1.2.3.4"), 111, AddressType.Main), publisherAvailability.ToAddress());
            Assert.Equal(Address.From(Host.Of("1.2.3.4"), 111, AddressType.Op), publisherAvailability.ToAddress(AddressType.Op));
        }
        //====================================
        // internal implementation
        //====================================

        private void ManageDirectoryChannel(string maybePublisherAvailability)
        {
            var publisherAvailability = PublisherAvailability.From(maybePublisherAvailability);

            if (publisherAvailability.IsValid)
            {
                if (!publisherAvailability.Equals(_directory))
                {
                    _directory = publisherAvailability;
                    _directoryChannel?.Close();
                    _directoryChannel = new SocketChannelWriter(_testAddress ?? _directory.ToAddress(), Logger);
                }
            }
        }