public void harvest ( RtpPortManager portManager ) throws HarvestException , NoCandidatesGatheredException { // Initialize the selector if necessary if ( this . selector == null || ! this . selector . isOpen ( ) ) { try { this . selector = Selector . open ( ) ; } catch ( IOException e ) { throw new HarvestException ( "Could not initialize selector" , e ) ; } } // Gather candidates for each media stream for ( IceMediaStream mediaStream : getMediaStreams ( ) ) { this . harvestManager . harvest ( mediaStream , portManager , this . selector ) ; } }
Gathers all available candidates and sets the components of each media stream .