private void sendTransportCandidatesOffer ( ) throws XMPPException , SmackException , InterruptedException { List < TransportCandidate > notOffered = resolver . getCandidatesList ( ) ; notOffered . removeAll ( offeredCandidates ) ; // Send any unset candidate for ( Object aNotOffered : notOffered ) { sendTransportCandidateOffer ( ( TransportCandidate ) aNotOffered ) ; } // .. and start a listener that will send any future candidate if ( resolverListener == null ) { // Add a listener that sends the offer when the resolver finishes... resolverListener = new TransportResolverListener . Resolver ( ) { @ Override public void candidateAdded ( TransportCandidate cand ) throws NotConnectedException , InterruptedException { sendTransportCandidateOffer ( cand ) ; } @ Override public void end ( ) { } @ Override public void init ( ) { } } ; resolver . addListener ( resolverListener ) ; } if ( ! ( resolver . isResolving ( ) || resolver . isResolved ( ) ) ) { // Resolve our IP and port LOGGER . fine ( "RESOLVER CALLED" ) ; resolver . resolve ( session ) ; } }
Create a Jingle stanza where we announce our transport candidates .