Polling the server, bad idea?
Hey Guys
Ive got a quick question. My rmi client checks the server every 10 seconds to see if there is an update. I was wondering if this was costly to the server, calling a remote method constantly.
Steps:
1. The client registers with the server
2. the server sends a user object back to the client
3. the client checks this user object every 10 seconds to see if an update has occured
Code
method on client calling remote object
new Thread(new Runnable(){
publicvoid run()
{
while(true)
{
try
{
Thread.sleep(10000);
if(isConnected())
{
System.out.println(client.getMessages().size());
System.out.println("Thread..." + Thread.currentThread().getName());
}
else
{
System.out.println("ohoh");
System.out.println("Thread..." + Thread.currentThread().getName());
}
}
catch(InterruptedException ex)
{
ex.printStackTrace();
}
catch(RemoteException ex)
{
ex.printStackTrace();
}
}
}
}).start();
I did a test and on the client is showed that there was only one thread created, not many. This is okay, but what about the server?
Any thoughts
Cheers for any help

