Remoting: Determine a TcpChannel's IP and Port

Posted on 2005-04-06
Last Modified: 2008-02-01
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 ?


Question by:TomBig
    LVL 20

    Accepted Solution

    TcpChannel channel = (TcpChannel) ChannelServices.GetChannel("theRegisteredChannelName");
    ChannelDataStore data = (ChannelDataStore) channel.ChannelData;
    data.ChannelUris -> array of channel uris that the current channel maps to


    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.

    LVL 1

    Author Comment

    hi jhenry.

    thanks. i guess that works.

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


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now