Apache Directory Project - [mina] How i can make a redundant connection

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > October 2005 > [mina] How i can make a redundant connection





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [mina] How i can make a redundant connection
Emir Rodriguez

2005-10-20, 5:45 pm

Hi,

I am making an app with mina, and i need that when the
connection from the server is broken, the client could
try to reconnect to the server since some time defined
in a config file.

I try to do this, with the events that fire mina,
sessionClosed(), with something like this:

if (agent instanceof ClientAgent) {
int timeOut = agent.getTimeOut();
agent.stop();

if (timeOut >= 0) {
if (timeOut == 0)
timeOut = 60;
while (!agent.isRunning()) {
try {
// Thread.sleep(timeOut*1000);
agent.start();
// } catch (InterruptedException e) {
// Ignore
} catch (DigiCOMMException e) {
// Ignore
}
}
} else
commonProtocol.sessionClosed(session);
} else
commonProtocol.sessionClosed(session);





________________________________________
___________________
Do You Yahoo!?
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com