Hello,

I have a question regarding client-side timeouts in Jini / Apache River. I
am finishing a program where a certain number of clients can obtain a proxy
and set / get properties (values) from an exported class in a server. Each
client becomes a RemoteEventListener of the server, so each time a property
is changed, the server calls notify() in ALL clients to make them aware
that a property has changed (and all clients update their data).

This architecture performs great if client programs finish in a "graceful"
way, because I have a register / unregister mechanism that makes the server
have an updated list of "alive" clients. However, if client machines "die
suddenly", the server will be unaware and will try to call notify() next
time that call is needed. Example (setSomething is a remote method on the
Server):

 public void setSomething(String param) {

<do the Stuff>
Remote event ev = <proper RemoteEvent object>
for(RemoteEventListener l : listeners) {

try {

l.notify(ev);

} catch(Exception e) {   listeners.remove(l);   }

}

}

I'm sure you see where I want to go: if some clients in the list died
suddenly, the notify() will be called over them. A ConnectException is
thrown and the client is removed properly but... it takes a long time for
the exception to be thrown! Do you know how to control this situation?

Thanks in advance!

ADDITIONAL DATA:
I have tried setting un the following RMI System properies, and didn't work:
System.setProperty("sun.rmi.transport.tcp.responseTimeout","2000");
System.setProperty("sun.rmi.transport.tcp.handshakeTimeout","2000");
System.setProperty("sun.rmi.transport.tcp.readTimeout","2000");
System.setProperty("sun.rmi.transport.connectionTimeout","2000");
System.setProperty("sun.rmi.transport.proxy.connectTimeout ","2000");

At present moment, under Windows XP for both client and server, the
ConnectException takes exactly* 21 seconds* to be thrown. Do you know the
reason for this value?

-- 
*Sergio Aguilera*

Reply via email to