protected void init ( ) { done = false ; connectionID = null ; readerThread = new Thread ( ) { public void run ( ) { parsePackets ( this ) ; } } ; readerThread . setName ( "Smack Packet Reader (" + connection . connectionCounterValue + ")" ) ; readerThread . setDaemon ( true ) ; // Create an executor to deliver incoming packets to listeners. We'll // use a single // thread with an unbounded queue. listenerExecutor = Executors . newSingleThreadExecutor ( new ThreadFactory ( ) { public Thread newThread ( Runnable runnable ) { Thread thread = new Thread ( runnable , "Smack Listener Processor (" + connection . connectionCounterValue + ")" ) ; thread . setDaemon ( true ) ; return thread ; } } ) ; resetParser ( ) ; }
Initializes the reader in order to be used . The reader is initialized during the first connection and when reconnecting due to an abruptly disconnection .