Problems using RMI between linux and windows.
I have problems using RMI between linux and windows.
This is my scenario:
- Server running on linux pc
- Clients running on linux and windows PCs
When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
Any ideas?
Thanks in advance.
cambieri
[699 byte] By [
cambieria] at [2007-11-27 11:12:07]

# 2
Thanks for your reply.
Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
Beside this, using the Thread seem to give us better performance.
Is that missed ConnectException a bug? Or we are just making some mistake?
We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
I hope that now this information are enough.
Thanks again and greetings.
O.C.
# 4
Wow! This is a fast reply! :-)
Ok, I'll try tomorrow morning when we'll be in our production office with all the network and system setted up.
Thaks again, see you tomorrow.
O.C.
# 5
Hi.
Thanks to your suggested logs we have seen that our Linux server receive a ConnectException trying to contact a dead Windows client only after 3 minutes of wait; while trying to contact a dead Linux client the ConnectException comes immediately at the first attempt to contact the client.
We have already solved putting the update instruction (that implement the callback from server to client) in a separate Thread and thanks to your suggestion now we are sure that after 3 minutes the thread will be freed.
Why this different behavior between Windows and Linux clients? Is this by design or is it a bug?
Thanks again and greetings.
O.C.