j2meP2PClient.nReconnectHandler Interface Reference

This interface should be implemented by classes wishing to register to receive callbacks when sessions are disconnected or to take control over the reconnect logic. More...

Inherited by j2meP2PClient.nServiceWorker.


Public Member Functions

void disconnected (nObject anSession)
 This method is called asynchronously when a session is disconnected.
void reconnected (nObject anSession)
 This method is called asynchronously when a session is reconnected.
boolean tryAgain (nObject anSession)
 This method is called asynchronously between a session being disconnected and a reconnection attempt.

Detailed Description

This interface should be implemented by classes wishing to register to receive callbacks when sessions are disconnected or to take control over the reconnect logic.

Member Function Documentation

void j2meP2PClient.nReconnectHandler.disconnected ( nObject  anSession  ) 

This method is called asynchronously when a session is disconnected.

Parameters:
anSession The session that got disconnected

void j2meP2PClient.nReconnectHandler.reconnected ( nObject  anSession  ) 

This method is called asynchronously when a session is reconnected.

Parameters:
anSession The session that got reconnected

boolean j2meP2PClient.nReconnectHandler.tryAgain ( nObject  anSession  ) 

This method is called asynchronously between a session being disconnected and a reconnection attempt.

If you wish to use the default reconnect logic, simply return true. If not return false and implement your own custom reconnect logic.

Parameters:
anSession The session to try and reconnect
Returns:
a boolean specifying whether the default reconnect logic should be used or not.