1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Use Alternative Session Address if default on fail

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7978 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-04-11 02:17:50 +00:00 committed by thiago
parent eb3d196bce
commit 60e0222c14

View file

@ -33,12 +33,15 @@ import javax.media.protocol.PushBufferStream;
import javax.media.rtp.RTPManager; import javax.media.rtp.RTPManager;
import javax.media.rtp.SendStream; import javax.media.rtp.SendStream;
import javax.media.rtp.SessionAddress; import javax.media.rtp.SessionAddress;
import javax.media.rtp.InvalidSessionAddressException;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.sun.media.rtp.RTPSessionMgr;
/** /**
* An Easy to use Audio Channel implemented using JMF. * An Easy to use Audio Channel implemented using JMF.
* It sends and receives jmf for and from desired IPs and ports. * It sends and receives jmf for and from desired IPs and ports.
@ -356,7 +359,18 @@ public class AudioChannel {
bc.setBufferLength(bl); bc.setBufferLength(bl);
} }
rtpMgrs[i].initialize(localAddr); try {
rtpMgrs[i].initialize(localAddr);
}
catch (InvalidSessionAddressException e) {
// In case the local address is not allowed to read, we user another local address
SessionAddress sessAddr = new SessionAddress();
localAddr = new SessionAddress(InetAddress.getByName(sessAddr.getDataHostAddress()),
localPort);
rtpMgrs[i].initialize(localAddr);
}
rtpMgrs[i].addTarget(destAddr); rtpMgrs[i].addTarget(destAddr);