This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Distributed Java and the fly likes RMI Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Problem" Watch "RMI Problem" New topic
Author

RMI Problem

Ramesh Pramuditha Rathnayake
Ranch Hand

Joined: Oct 31, 2012
Posts: 169
    
    1

I have developed a Server software and a Client software using java RMI.
Is there a way to determine whether a client machine has disconnected from the Server machine..??


Ramesh-X
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

What do you mean by "disconnected"? That concept only means something when the design includes a connection, but normally RMI doesn't require or use one.
Ramesh Pramuditha Rathnayake
Ranch Hand

Joined: Oct 31, 2012
Posts: 169
    
    1

I have send a factory class through server for the clients. Clients can get different objects from that factory and can work with them. If a client shut down the computer without exiting the software(therefore JVM is terminated), how can I recognize that a client has log out..??
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I still don't understand the design. You mentioned a factory class, but then you started talking about a client logging out without explaining how the login/logout mechanism worked.
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Ramesh Pramuditha Rathnayake wrote:I have send a factory class through server for the clients. Clients can get different objects from that factory and can work with them. If a client shut down the computer without exiting the software(therefore JVM is terminated), how can I recognize that a client has log out..??

The explanation is really vague and lacks some details. Anyway, like everywhere in socket communication, you can't be sure if the client still exists until you try to send something to him and get the response back, no response - no client.
 
Consider Paul's rocket mass heater.
 
subject: RMI Problem