directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Rodriguez <emirrodrigu...@yahoo.com.mx>
Subject [mina] How i can make a redundant connection
Date Thu, 20 Oct 2005 18:55:28 GMT
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 


Mime
View raw message