private void initConnection ( ) throws IOException , InterruptedException { compressionHandler = null ; // Set the reader and writer instance variables initReaderAndWriter ( ) ; int availableReaderWriterSemaphorePermits = readerWriterSemaphore . availablePermits ( ) ; if ( availableReaderWriterSemaphorePermits < 2 ) { Object [ ] logObjects = new Object [ ] { this , availableReaderWriterSemaphorePermits , } ; LOGGER . log ( Level . FINE , "Not every reader/writer threads where terminated on connection re-initializtion of {0}. Available permits {1}" , logObjects ) ; } readerWriterSemaphore . acquire ( 2 ) ; // Start the writer thread. This will open an XMPP stream to the server packetWriter . init ( ) ; // Start the reader thread. The startup() method will block until we // get an opening stream packet back from server packetReader . init ( ) ; }
Initializes the connection by creating a stanza reader and writer and opening a XMPP stream to the server .