Remoting Server Connections not closing RRS feed

  • Question


    Hi all, I have developed a client/server application using .net remoting as for the communications (using TCP and binary formatter).


    What I have noticed is that when the client drops offline, and the server remote object becomes unreachable, the connection on the server stays as ESTABLISHED, and when the client has it's next successful remoting call, that a new connection on the server is opened (same port as before).


    If the client goes online/offline a number of times, these connections begin to build up and never go away (when I did it many times, I had so many connections on the server, the Remoting stopped working!)


    The same thing happens for both SingleCall and Singleton remote object


    I have searched high and low for others who have noticed this, but found nothing.


    Does anyone have any idea how to get rid of these "old" connections once the client "reconnects"

    Any help would by greatly appretiated!


    Tuesday, February 5, 2008 10:33 PM

All replies

  • Interesting.  I'm looking for a repro of this problem.  Can you tell me more on how your client 'drops offline'?  Also, just to make sure, you mean that your server remote object becomes 'unreachable' to this client at this point and other clients are OK, correct?

    Wednesday, February 6, 2008 8:17 PM
  • Hi Ryszard, thanks for your reply!


    All I'm doing to test this is going to Control Panel | Network Connections, and disabling my Local area connection, and then once my client "knows it is disconnected" (ie a remoting call fails) I reconnect it. Doing this to try and emulate a wireless client going on and offline.


    In the client app, once it realizes it is "disconnected" (ie remote object unreachable), we continuouly just keep trying to contact it via a timer (ie call a remote method on it) until we succeed. When "online", we Ping it (ie call a remote method called Ping) to test for reachability


    If you wanted to look at the code, I have made my test app available on our ftp site...



    Username:     public

    Password:     micromine


    File is TestRemoting-DotNet.zip


    (Or, I can email it to you if you want)


    The test app has a client and 2 server projects.


    All I do is run the client on one machine, and the server (ignore the server2 project) on another. In the client set

    member variable m_addy to the server ip


    There is a little bit of un needed junk in the test app, as I've used it to try various things, but hopefully can see the call to the remote object (and I pass in a client callback so the server can push to the client), and the timer that either trys to connect, or ping.


    To run client, just click the start button (little box should be green when connected, red when not - ie when the ping call times out)


    Then, on the server I watch the connections using something like tcpview...




    Using this, you can see when the client network is disconnected, the connexction stays there forever (until you close the server app down)


    Any extra help would be greatly appretiated!





    Saturday, February 9, 2008 2:46 AM