Minor cleanup.
This commit is contained in:
parent
eac04a777d
commit
9b9fbb71d0
@ -85,6 +85,13 @@ public class Agent
|
||||
private static final Logger logger
|
||||
= Logger.getLogger(Agent.class.getName());
|
||||
|
||||
/**
|
||||
* The name of the {@link PropertyChangeEvent} that we use to deliver
|
||||
* events on changes in the state of ICE processing in this agent.
|
||||
*/
|
||||
public static final String PROPERTY_ICE_PROCESSING_STATE
|
||||
= "IceProcessingState";
|
||||
|
||||
/**
|
||||
* The LinkedHashMap used to store the media streams
|
||||
* This map preserves the insertion order of the media streams.
|
||||
@ -124,13 +131,6 @@ public class Agent
|
||||
*/
|
||||
private final DefaultNominator nominator;
|
||||
|
||||
/**
|
||||
* The name of the {@link PropertyChangeEvent} that we use to deliver
|
||||
* events on changes in the state of ICE processing in this agent.
|
||||
*/
|
||||
public static final String PROPERTY_ICE_PROCESSING_STATE
|
||||
= "IceProcessingState";
|
||||
|
||||
/**
|
||||
* The value of <tt>Ta</tt> as specified by the application or <tt>-1</tt>
|
||||
* if non was specified and we should calculate one ourselves.
|
||||
@ -141,7 +141,7 @@ public class Agent
|
||||
* The <tt>List</tt> of remote addresses that we have discovered through
|
||||
* incoming connectivity checks, before actually receiving a session
|
||||
* description from the peer and that may potentially contain peer reflexive
|
||||
* addresses. This list is stored and only if and while connectivity checks
|
||||
* addresses. This list is stored only if and while connectivity checks
|
||||
* are not running. Once they start, we are able to determine whether the
|
||||
* addresses in here are actually peer-reflexive or not, and schedule
|
||||
* the necessary triggered checks.
|
||||
@ -241,7 +241,7 @@ public class Agent
|
||||
private boolean shutdown = false;
|
||||
|
||||
/**
|
||||
* Indicates that harvesting has been started at least ones. Used to warn
|
||||
* Indicates that harvesting has been started at least once. Used to warn
|
||||
* users who are trying to trickle, that they have already completed a
|
||||
* harvest. We may use it to throw an exception at some point if it's ever
|
||||
* a problem.
|
||||
@ -301,8 +301,8 @@ public class Agent
|
||||
|
||||
// Since we add a new stream, we must wait to add the component and the
|
||||
// remote candidates before starting to "RUN" this Agent.
|
||||
// This is usefull if this Agent is already in COMPLETED state
|
||||
// (isStarted() == true) due to a previous successful ICE preocedure:
|
||||
// This is useful if this Agent is already in COMPLETED state
|
||||
// (isStarted() == true) due to a previous successful ICE procedure:
|
||||
// this way incoming connectivity checks are registered in the
|
||||
// preDiscoveredPairsQueue until this Agent is in RUNNING state.
|
||||
this.setState(IceProcessingState.WAITING);
|
||||
@ -322,7 +322,7 @@ public class Agent
|
||||
* @param minPort the port number where we should first try to bind before
|
||||
* moving to the next one (i.e. <tt>minPort + 1</tt>)
|
||||
* @param maxPort the maximum port number where we should try binding
|
||||
* before giving up and throwinG an exception.
|
||||
* before giving up and throwing an exception.
|
||||
*
|
||||
* @return the newly created {@link Component} and with a list containing
|
||||
* all and only local candidates.
|
||||
@ -364,10 +364,10 @@ public class Agent
|
||||
|
||||
/*
|
||||
* Lyubomir: After we've gathered the LocalCandidate for a Component and
|
||||
* before we've make them available to the caller, we have to make sure
|
||||
* before we've made them available to the caller, we have to make sure
|
||||
* that the ConnectivityCheckServer is started. If there's been a
|
||||
* previous connectivity establishment which has completed, it has
|
||||
* stopped the ConnectivityCheckServer. If the ConnectivtyCheckServer is
|
||||
* stopped the ConnectivityCheckServer. If the ConnectivityCheckServer is
|
||||
* not started after we've made the gathered LocalCandidates available
|
||||
* to the caller, the caller may send them and a connectivity check may
|
||||
* arrive from the remote Agent.
|
||||
@ -1388,9 +1388,8 @@ public class Agent
|
||||
{
|
||||
//first check whether we already know about the remote address in case
|
||||
//we've just discovered a peer-reflexive candidate.
|
||||
CandidatePair knownPair = null;
|
||||
|
||||
knownPair = this.findCandidatePair(
|
||||
CandidatePair knownPair
|
||||
= findCandidatePair(
|
||||
triggerPair.getLocalCandidate().getTransportAddress(),
|
||||
triggerPair.getRemoteCandidate().getTransportAddress());
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ public class HostCandidateHarvester
|
||||
= Logger.getLogger(HostCandidateHarvester.class.getName());
|
||||
|
||||
/**
|
||||
* Manages statisics about harvesting time.
|
||||
* Manages statistics about harvesting time.
|
||||
*/
|
||||
private HarvestStatistics harvestStatistics = new HarvestStatistics();
|
||||
|
||||
@ -312,7 +312,7 @@ public class HostCandidateHarvester
|
||||
* @param minPort the port number where we should first try to bind before
|
||||
* moving to the next one (i.e. <tt>minPort + 1</tt>)
|
||||
* @param maxPort the maximum port number where we should try binding
|
||||
* before giving up and throwinG an exception.
|
||||
* before giving up and throwing an exception.
|
||||
*
|
||||
* @return the newly created <tt>DatagramSocket</tt>.
|
||||
*
|
||||
@ -488,7 +488,7 @@ public class HostCandidateHarvester
|
||||
* @param minPort the port number where we should first try to bind before
|
||||
* moving to the next one (i.e. <tt>minPort + 1</tt>)
|
||||
* @param maxPort the maximum port number where we should try binding
|
||||
* before giving up and throwinG an exception.
|
||||
* before giving up and throwing an exception.
|
||||
*
|
||||
* @throws IllegalArgumentException if either <tt>minPort</tt> or
|
||||
* <tt>maxPort</tt> is not a valid port number or if <tt>minPort</tt> is
|
||||
|
||||
@ -19,11 +19,11 @@ public abstract class IceSocketWrapper
|
||||
/**
|
||||
* Sends a <tt>DatagramPacket</tt> from this socket
|
||||
* It is a utility method to provide a common way to send for both
|
||||
* UDP and TCP socket. If the underlying socket is a TCP ones, it is still
|
||||
* UDP and TCP socket. If the underlying socket is a TCP one, it is still
|
||||
* possible to get the <tt>OutputStream</tt> and do stuff with it.
|
||||
*
|
||||
*
|
||||
* @param p <tt>DatagramPacket</tt> to sent
|
||||
* @param p <tt>DatagramPacket</tt> to send
|
||||
* @throws IOException if something goes wrong
|
||||
*/
|
||||
public abstract void send(DatagramPacket p)
|
||||
@ -32,7 +32,7 @@ public abstract class IceSocketWrapper
|
||||
/**
|
||||
* Receives a <tt>DatagramPacket</tt> from this socket.
|
||||
* It is a utility method to provide a common way to receive for both
|
||||
* UDP and TCP socket. If the underlying socket is a TCP ones, it is still
|
||||
* UDP and TCP socket. If the underlying socket is a TCP one, it is still
|
||||
* possible to get the <tt>InputStream</tt> and do stuff with it.
|
||||
*
|
||||
* @param p <tt>DatagramPacket</tt>
|
||||
@ -68,20 +68,20 @@ public abstract class IceSocketWrapper
|
||||
public abstract SocketAddress getLocalSocketAddress();
|
||||
|
||||
/**
|
||||
* Returns Socket object if the delegate socket is a TCP ones, null
|
||||
* Returns Socket object if the delegate socket is a TCP one, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return Socket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* @return Socket object if the delegate socket is a TCP one, null
|
||||
* otherwise.
|
||||
*/
|
||||
public abstract Socket getTCPSocket();
|
||||
|
||||
/**
|
||||
* Returns DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* Returns DatagramSocket object if the delegate socket is a UDP one, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* @return DatagramSocket object if the delegate socket is a UDP one, null
|
||||
* otherwise.
|
||||
*/
|
||||
public abstract DatagramSocket getUDPSocket();
|
||||
}
|
||||
|
||||
@ -135,24 +135,18 @@ public class IceTcpSocketWrapper
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Socket object if the delegate socket is a TCP ones, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return Socket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Socket getTCPSocket()
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public DatagramSocket getUDPSocket()
|
||||
{
|
||||
return null;
|
||||
|
||||
@ -87,24 +87,18 @@ public class IceUdpSocketWrapper
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Socket object if the delegate socket is a TCP ones, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return Socket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Socket getTCPSocket()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* otherwise.
|
||||
*
|
||||
* @return DatagramSocket object if the delegate socket is a TCP ones, null
|
||||
* otherwise
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public DatagramSocket getUDPSocket()
|
||||
{
|
||||
return socket;
|
||||
|
||||
@ -317,18 +317,19 @@ public class MultiplexingSocket
|
||||
* @throws SocketTimeoutException if the timeout has expired
|
||||
* @throws IOException if an I/O error occurs
|
||||
*/
|
||||
private void receive(List<DatagramPacket> received, DatagramPacket p,
|
||||
int timeout)
|
||||
private void receive(List<DatagramPacket> received,
|
||||
DatagramPacket p,
|
||||
int timeout)
|
||||
throws SocketTimeoutException, IOException
|
||||
{
|
||||
long now, start = System.currentTimeMillis();
|
||||
long now, start = System.currentTimeMillis();
|
||||
DatagramPacket r = null;
|
||||
|
||||
do
|
||||
{
|
||||
now = System.currentTimeMillis();
|
||||
if (timeout > 0 && now - start >= timeout)
|
||||
throw new SocketTimeoutException("Socket timeout");
|
||||
now = System.currentTimeMillis();
|
||||
if (timeout > 0 && now - start >= timeout)
|
||||
throw new SocketTimeoutException("Socket timeout");
|
||||
|
||||
boolean doReceive;
|
||||
|
||||
@ -341,10 +342,10 @@ public class MultiplexingSocket
|
||||
doReceive = false;
|
||||
try
|
||||
{
|
||||
if (timeout > 0)
|
||||
receiveSyncRoot.wait(timeout - (now - start));
|
||||
else
|
||||
receiveSyncRoot.wait();
|
||||
if (timeout > 0)
|
||||
receiveSyncRoot.wait(timeout - (now - start));
|
||||
else
|
||||
receiveSyncRoot.wait();
|
||||
}
|
||||
catch (InterruptedException iex)
|
||||
{
|
||||
|
||||
@ -56,7 +56,7 @@ public class StunStack
|
||||
/**
|
||||
* Our network gateway.
|
||||
*/
|
||||
private NetAccessManager netAccessManager = null;
|
||||
private final NetAccessManager netAccessManager;
|
||||
|
||||
/**
|
||||
* The {@link CredentialsManager} that we are using for retrieving
|
||||
@ -464,8 +464,6 @@ public class StunStack
|
||||
ioex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Sends a specific STUN <tt>Indication</tt> to a specific destination
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user