File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes How dose a RMI server guarantee that return object can be sent back to client? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "How dose a RMI server guarantee that return object can be sent back to client?" Watch "How dose a RMI server guarantee that return object can be sent back to client?" New topic
Author

How dose a RMI server guarantee that return object can be sent back to client?

Lin Feng
Ranch Hand

Joined: Dec 11, 2002
Posts: 142
My question is when you implement a RMI server, how could the server guarantee the response can be sent back to client?
If the network is broken after the call has been sent out by client , the client will get an exception. However the server remote method implementation code dose not know that the network is broken. So it will continue to execute and return. Then the execution point would be somewhere in the skeleton code. The server try to send back response and find the network is broken.
So it seems that when we develop the RMI program , we have no chance to handle the network exception. RMI just want to make the network transparent. But sometimes the server has to do something when the network is broken.
Yes , the server can try to wait for an acknowledgement from the client. However it is not the mechanism of RMI. It seems that for the server , the RMI sounds like IP. But there is no "TCP for RMI" available. You have to develop your own.
Am I right? If the RMI server cannot handle everything correctly, who would like to use it. It seems that there are something I do not know. Could you please give me a hint?
Thanks
raimondas zemaitis
Ranch Hand

Joined: Feb 23, 2001
Posts: 104
Your question seens somewhat messy. When you invoke method on remote object you either get response or some exception if smth is wrong.
Why should you care about low level TCP ?
You would get java.rmi.ConnectException if network is down. If your app is made correctly it should be able to handle this. I've written quite a bit of RMI servers and this never is a problem.
Lin Feng
Ranch Hand

Joined: Dec 11, 2002
Posts: 142
Raimondas,
Thank you for your reply. It seems that I did not explain my questions clearly. What I care is the server side other than the client side. For the client side you can catch an exception when there is network problem. However for the server side, your code will not be in the running stack at that time, how could you catch an exception?
Jawad Kakar
Ranch Hand

Joined: Oct 06, 2002
Posts: 82
Try not to post the same msg in different forum.
Jawad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How dose a RMI server guarantee that return object can be sent back to client?