• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 445
  • Last Modified:

Remoting: Determine a TcpChannel's IP and Port

hi there

this little problem bothers me:

when using a configuration file to configure a tcp channe, assuming i don't know the files content, then how can i determine at runtime what the channel's ip adress and port are. or can't i ?

cheers

TomBig
0
TomBig
Asked:
TomBig
1 Solution
 
ihenryCommented:
TcpChannel channel = (TcpChannel) ChannelServices.GetChannel("theRegisteredChannelName");
ChannelDataStore data = (ChannelDataStore) channel.ChannelData;
data.ChannelUris -> array of channel uris that the current channel maps to

Or

String[] urls = ChannelServices.GetUrlsForObject(theMbrObj);
urls -> array of channel uris that the current channel maps to

Just parse one of the uri to get the port and ip address.


0
 
TomBigAuthor Commented:
hi jhenry.

thanks. i guess that works.

maybe one more question. how can i set "theRegisteredChannelName" in the config file ?

cheers
TomBig
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now