Connecting to a .net remoting server over lan

Posted on 2009-02-18
Last Modified: 2012-05-06

I am connecting to a .net remoting server over a LAN to retrieve data.  When it is not being updated with high frequency real-time data, I can retrieve the data I need.

However, when it is being updated with real-time data I get the following error:

No connection could be made because the target machine actively refused it.

Any ideas how to get the data?  The data retrieval should be given priority over the updates.

Question by:gustierng
    LVL 14

    Expert Comment

    by:Daniel Junges
    Plese give me more info:
    - Protocoll use
    - server type
    - detailed error message
    - server log file message

    can you debug the server ?

    are you closing all conection properly?

    Author Comment


    I think i need a channel / port for each user connecting and one for the real-time updates.

    Any guidance here would be helpful...
    LVL 14

    Expert Comment

    by:Daniel Junges
    i have an server with one thread listening for new conections, after an connection arrived the it starts a new thread for the new connection.

    is the server written by you?

    is a server log file present ?

    Author Comment

    do you have any examples of what you are discussing?

    The server has been adapted from some code written by others.

    there are no log files as such.  The logs are available but not persisted.

    Author Comment

    how do I keep a connection open for all users so that listens for new connections?

    so that it does not lock out other users?
    LVL 14

    Accepted Solution


          int PortNumber = 10000;
          TcpListener MyListener = new TcpListener(PortNumber);
             TcpClient MyClient = MyListener.AcceptTcpClient();
             NetworkStream MyNetStream = MyClient.GetStream();
             // star new thread and pass instance of "MyNetStream"
    on the Client Thread
      call MyClient.Close(); when finished

    Open in new window


    Author Comment

    So you suggest I use System.Net to maintain a shared port rather than .net remoting?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 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

    18 Experts available now in Live!

    Get 1:1 Help Now