Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3792736
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:40:08+00:00 2026-05-19T12:40:08+00:00

The grand design is the following: There is certain application that gets installed as

  • 0

The grand design is the following:

  1. There is certain application that gets installed as a Windows Service
  2. There may be several of these on the network
  3. Each of them exposes some interface to the network (think of it as “remote control” or “configuration” – that kind of thing)
  4. Then there is another application that acts as a client for that interface (using same analogies – “remote controller” or “configuration tool”)
  5. The objective of the latter is to sniff out all instances of the former on the network, display them as a list to the user and allow the user to poke them in different places using that exposed interface (i.e. “remote control” or “configure” them)
  6. For the sake of simplicity, let’s assume that everybody is in the same network – that is, everybody can hear each other’s UDP broadcasts.

Pretty straightforward, eh? I used to build this kind of things by the dozen in ye olden days, using roll-my-own UDP-broadcast-based discovery mechanism.

But now I thought I’d be cool and hip, and go with the groovy WCF Discovery in Ad Hoc mode. And it works! Who could tell? 🙂

But not quite.
As was noted before me here and there, the discovery returns the hard-coded URL from service’s config. That is, if the service has <baseAddresses><add baseAddress="net.tcp://localhost:1234/My/Service" /></baseAddresses> in it’s config file, then that’s exactly what I’m going to get from discovery client – including the “localhost” part.

Needless to say, if I try to call the service using that URL, the result is not thrilling.

So the question is: how do I make the discovery client give me the usable URL instead of that localhost-ish garbage?

To save everybody’s time, a couple of thoughts that don’t work:

  1. Change the service’s config file at deployment time, encoding it’s real IP address or machine name.
    Doesn’t work, because both IP and machine name may change.
  2. Configure the service from code (at least partially), using current IP or machine name to construct the URL.
    Doesn’t work. Machine name is useless, because there might not be a dns in the network. IP is useless, because the computer may be on several networks at once, and thus, have several IP addresses (this is not hypothetical, we actually do have this situation). Which one to use then?

In other words, I need not to tweak the service, but rather to make the discovery client give me the address that the discovery response came from.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:40:09+00:00Added an answer on May 19, 2026 at 12:40 pm

    You should be able to fix this by replacing localhost with a wildcard:

    <baseAddresses><add baseAddress="net.tcp://*:1234/My/Service" /></baseAddresses>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am really only a hobbyist, who has aspirations far too grand, that said,
I'm trying to figure out how to design a small application more elegantly, and
How do I get blocks/grand central dispatch working in Snow Leopard? It appears that
Is there a way I can find the grand parent of a div and
Assume I have the following example hierarchy: US Michigan Detroit Grand Rapids Lansing Minnesota
I have 5 functions that need to be run on a separate thread. Grand
I am testing some code that does asynchronous processing using Grand Central Dispatch. The
Is there a easy way to calculate the grand total of all the numberic
here is the code that i am using for the sub totals and grand
OS: Windows Language: C/C++ The design demands to use a mutex variable across process

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.