determine remoting configuration in runtime

  • Thread starter Thread starter My interest
  • Start date Start date
M

My interest

Is it possible to determine the remoting settting in runtime from
within the host class?

Assuming I have a class Bar whose listening URI is tcp://localhost:2345/Bar.
This URI is specified in the app.cfg and the remoting configuration is
done using RemotingCOnfiguration.Config(). Is there anyway within the
class Bar to determine the URI(s) it is serving request? i.e. is
there a way to write a String Bar::GetID() function with return
tcp://localhost:2345/Bar
 
I don't believe there is. The best you could do is look at the
configuration options and then see what type is being remoted and then
compare to your type. However, this doesn't tell you if your particular
instance is being remoted.

In WCF, you can get this information, because you have an
OperationContext which you can get for the current thread to see if you are
in the middle of a call originating over WCF.

Hope this helps.
 
Back
Top