This content has been marked as final. Show 9 replies
Any ideas any body?
Guess not :-(
During this time it's possible that the client is terminated and/or the connection is dropped.The connection will only be dropped if either the client or the server is terminated or an intermediate firewall times it out.
Is there a way for the JVM on the client to detect that the port has closed?No, because the port won't have closed. The connection may have been dropped; that's not the same thing. RMI does use TCP keep-alive, which can detect a broken connection but only after two hours.
Thanks for getting back to me - it's much appreciated.
I'm trying to find some mechanism for the server detecting that the client has gone away. I was hoping that closing the socket might have been the answer, but it looks as if that isn't the case. In that case is it possible that:
1) I can configure the RMI keep-alive for a much lower value (a couple of minutes would be acceptable)
2) Is there some other mechanism I could use to detect the client is no longer available?
I've tried using an interface to call the client, but unfortunately that doesn't work - every thing just locked up!
1) I can configure the RMI keep-alive for a much lower value (a couple of minutes would be acceptable)There isn't an RMI keep-alive. There is a TCP keep-alive. You can't configure it from Java.
2) Is there some other mechanism I could use to detect the client is no longer available?No.
OK, I guess it's back to the drawing board.
Thanks for your help.
make the initial operation asynchronous. client calls a "start operation" method (which returns immediately), then periodically calls a "check for result" method which hangs for a bit then returns null if no result yet or the result if the operation is finished. if the client stops calling the "check for result" method (within some time window), then the server knows the client is dead.
I too have a similar requirement. How will the server know that the client has terminated abruptly.
I have JMX client and MbeanServer on weblogic, which communicates as required. Gets the ip of the client and displays the process running on that client.
notification listener also works.
The problem I have is, if the client is terminated, it does not get reflected on the server. The server shows that client still listed, if it is stopped abruptly, when that process running has not completed and the mbean is not unregistered.
How can I get to know that the jmx client has terminated and unregister it from the server list.
The answer to your question was posted immediately above, in December 2009. Please read the thread before you revive it unnecessarily. Locking.