private void runSession ( ) { if ( ! started ) { logString ( "Thread Starting" ) ; completed = false ; seqNum = getStartSeqNum ( ) ; rtpStack . setNextZrtpSequenceNumber ( getStartSeqNum ( ) ) ; state = ZRTP_STATE_INACTIVE ; initiator = false ; hashMode = HashType . UNDEFINED ; dhMode = KeyAgreementType . DH3K ; sasMode = SasType . UNDEFINED ; farEndZID = null ; farEndH0 = null ; farEndClientID = "" ; isLegacyClient = false ; // farEndH1 = null; // farEndH2 = null; // farEndH3 = null; farEndZID = null ; dhPart1Msg = null ; dhPart2Msg = null ; rxHelloMsg = txHelloMsg = commitMsg = null ; msgConfirm1TX = msgConfirm2TX = null ; msgConfirm1RX = msgConfirm2RX = null ; msgErrorTX = null ; try { // TODO: create after algorithm negotiation dhSuite . setAlgorithm ( KeyAgreementType . DH3K ) ; // Initialize the retransmission timer interval timerInterval = T1_INITIAL_INTERVAL ; sendHello ( ) ; started = true ; } catch ( Throwable e ) { logError ( "Exception sending initial Hello message: " + e . toString ( ) ) ; e . printStackTrace ( ) ; completed = true ; } while ( ! completed ) { synchronized ( lock ) { try { lock . wait ( ) ; } catch ( Throwable e ) { logString ( "Thread Interrupted E:" + e ) ; } } processQueuedMessages ( ) ; } endSession ( ) ; logString ( "Thread Ending" ) ; } }
Thread run method