Removes unused publicAddress field.

This commit is contained in:
damencho 2015-11-05 13:55:03 -06:00
parent 6c99040496
commit 6a97941d68

View File

@ -133,28 +133,6 @@ public class SinglePortUdpHarvester
logger.info("Failed to get network interfaces: " + se); logger.info("Failed to get network interfaces: " + se);
} }
TransportAddress ec2Mask = AwsCandidateHarvester.getMask();
for (TransportAddress address : addresses)
{
TransportAddress publicAddress = null;
if (ec2Mask != null
&& ec2Mask.getAddress().equals(address.getAddress()))
{
publicAddress = AwsCandidateHarvester.getFace();
}
try
{
harvesters.add(
new SinglePortUdpHarvester(address, publicAddress));
}
catch (IOException ioe)
{
logger.info("Failed to create SinglePortUdpHarvester for "
+ "address " + address + ": " + ioe);
}
}
return harvesters; return harvesters;
} }
@ -192,11 +170,6 @@ public class SinglePortUdpHarvester
*/ */
private final DatagramSocket socket; private final DatagramSocket socket;
/**
* The public address that this harvester will use for reflexive candidates.
*/
private TransportAddress publicAddress = null;
/** /**
* The thread reading from {@link #socket}. * The thread reading from {@link #socket}.
*/ */
@ -206,12 +179,9 @@ public class SinglePortUdpHarvester
* Initializes a new <tt>SinglePortUdpHarvester</tt> instance which is to * Initializes a new <tt>SinglePortUdpHarvester</tt> instance which is to
* bind on the specified local address. * bind on the specified local address.
* @param localAddress the address to bind to. * @param localAddress the address to bind to.
* @param publicAddress the public address that this harvester will use for
* reflexive candidates.
* @throws IOException if initialization fails. * @throws IOException if initialization fails.
*/ */
public SinglePortUdpHarvester(TransportAddress localAddress, public SinglePortUdpHarvester(TransportAddress localAddress)
TransportAddress publicAddress)
throws IOException throws IOException
{ {
this.localAddress = localAddress; this.localAddress = localAddress;
@ -233,18 +203,6 @@ public class SinglePortUdpHarvester
thread.start(); thread.start();
} }
/**
* Initializes a new <tt>SinglePortUdpHarvester</tt> instance which is to
* bind on the specified local address.
* @param localAddress the address to bind to.
* @throws IOException if initialization fails.
*/
public SinglePortUdpHarvester(TransportAddress localAddress)
throws IOException
{
this(localAddress, null);
}
/** /**
* Perpetually reads datagrams from {@link #socket} and handles them * Perpetually reads datagrams from {@link #socket} and handles them
* accordingly. * accordingly.
@ -440,16 +398,16 @@ public class SinglePortUdpHarvester
candidates.put(ufrag, candidate); candidates.put(ufrag, candidate);
component.addLocalCandidate(candidate); component.addLocalCandidate(candidate);
if (publicAddress != null) // if (publicAddress != null)
{ // {
ServerReflexiveCandidate mappedCandidate // ServerReflexiveCandidate mappedCandidate
= new ServerReflexiveCandidate( // = new ServerReflexiveCandidate(
publicAddress, // publicAddress,
candidate, // candidate,
candidate.getStunServerAddress(), // candidate.getStunServerAddress(),
CandidateExtendedType.STATICALLY_MAPPED_CANDIDATE); // CandidateExtendedType.STATICALLY_MAPPED_CANDIDATE);
component.addLocalCandidate(mappedCandidate); // component.addLocalCandidate(mappedCandidate);
} // }
return new ArrayList<LocalCandidate>(Arrays.asList(candidate)); return new ArrayList<LocalCandidate>(Arrays.asList(candidate));
} }