```ruby
        def lookup_server_uri
          begin
            if service_directory.running?
              listing = service_directory.lookup(service)
              host = listing.try(:address)
              port = listing.try(:port)
            else
              host, port = options[:host], options[:port]
            end
          end until usable_server?( host, port )

          "tcp://#{host}:#{port}"
        end
```