private void cleanPipes ( ) { assert ( pipe != null ) ; // Get rid of half-processed messages in the out pipe. Flush any // unflushed messages upstream. pipe . rollback ( ) ; pipe . flush ( ) ; // Remove any half-read message from the in pipe. while ( incompleteIn ) { Msg msg = pullMsg ( ) ; if ( msg == null ) { assert ( ! incompleteIn ) ; break ; } // msg.close (); } }
Call this function when engine disconnect to get rid of leftovers .