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
LVL 1
TomBigAsked:
Who is Participating?
 
ihenryConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.