Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.icq
Class ProtocolProviderServiceIcqImpl.ConnectionClosedListener

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.icq.ProtocolProviderServiceIcqImpl.ConnectionClosedListener
All Implemented Interfaces:
net.kano.joscar.flap.FlapPacketListener
Enclosing class:
ProtocolProviderServiceIcqImpl

public static class ProtocolProviderServiceIcqImpl.ConnectionClosedListener
extends Object
implements net.kano.joscar.flap.FlapPacketListener

Fix for late close connection due to multiple logins. Listening for incoming packets for the close command when this is received we disconnect the session to force it because otherwise is wait for timeout of reading from the socket stream which leads to from 10 to 20 seconds delay of closing the session and connection


Constructor Summary
ProtocolProviderServiceIcqImpl.ConnectionClosedListener(net.kano.joustsim.oscar.AimConnection aimConnection)
           
 
Method Summary
(package private) static int convertAuthCodeToReasonCode(net.kano.joustsim.oscar.oscar.loginstatus.AuthFailureInfo afi)
          When receiving login failure the reasons for the failure are in the authorization part of the protocol ( 0x13 ) In the AuthResponse are the possible reason codes here they are converted to those in the ConnectionClosedListener so the they can be converted to the one in service protocol events
(package private) static int convertCodeToRegistrationStateChangeEvent(int reasonCode)
          Converts the codes in the close command or the lastCloseCode of OscarConnection to the states which are registered in the service protocol events
(package private) static String convertCodeToStringReason(int reasonCode)
          returns the reason string corresponding to the code in the close command
 void handleFlapPacket(net.kano.joscar.flap.FlapPacketEvent evt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolProviderServiceIcqImpl.ConnectionClosedListener

ProtocolProviderServiceIcqImpl.ConnectionClosedListener(net.kano.joustsim.oscar.AimConnection aimConnection)
Method Detail

handleFlapPacket

public void handleFlapPacket(net.kano.joscar.flap.FlapPacketEvent evt)
Specified by:
handleFlapPacket in interface net.kano.joscar.flap.FlapPacketListener

convertCodeToRegistrationStateChangeEvent

static int convertCodeToRegistrationStateChangeEvent(int reasonCode)
Converts the codes in the close command or the lastCloseCode of OscarConnection to the states which are registered in the service protocol events

Parameters:
reasonCode - int the reason of close connection
Returns:
int corresponding RegistrationStateChangeEvent

convertCodeToStringReason

static String convertCodeToStringReason(int reasonCode)
returns the reason string corresponding to the code in the close command

Parameters:
reasonCode - int the reason of close connection
Returns:
String describing the reason

convertAuthCodeToReasonCode

static int convertAuthCodeToReasonCode(net.kano.joustsim.oscar.oscar.loginstatus.AuthFailureInfo afi)
When receiving login failure the reasons for the failure are in the authorization part of the protocol ( 0x13 ) In the AuthResponse are the possible reason codes here they are converted to those in the ConnectionClosedListener so the they can be converted to the one in service protocol events

Parameters:
afi - AuthFailureInfo the failure info
Returns:
int the corresponding code to this failure

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.