Minor formatting/spelling fixes.
This commit is contained in:
parent
bc8ab03637
commit
2da5150e14
@ -131,7 +131,7 @@ public class Agent
|
|||||||
= "IceProcessingState";
|
= "IceProcessingState";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the value of <tt>Ta</tt> as specified by the application or <tt>-1</tt>
|
* 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.
|
* if non was specified and we should calculate one ourselves.
|
||||||
*/
|
*/
|
||||||
private long taValue = -1;
|
private long taValue = -1;
|
||||||
|
|||||||
@ -122,7 +122,7 @@ public abstract class LocalCandidate
|
|||||||
{
|
{
|
||||||
IceSocketWrapper hostSocket = getIceSocketWrapper();
|
IceSocketWrapper hostSocket = getIceSocketWrapper();
|
||||||
|
|
||||||
if(hostSocket.getTCPSocket() != null)
|
if (hostSocket.getTCPSocket() != null)
|
||||||
{
|
{
|
||||||
Socket tcpSocket = hostSocket.getTCPSocket();
|
Socket tcpSocket = hostSocket.getTCPSocket();
|
||||||
Socket tcpStunSocket = null;
|
Socket tcpStunSocket = null;
|
||||||
@ -178,7 +178,7 @@ public abstract class LocalCandidate
|
|||||||
|
|
||||||
return stunSocket;
|
return stunSocket;
|
||||||
}
|
}
|
||||||
else if(hostSocket.getUDPSocket() != null)
|
else if (hostSocket.getUDPSocket() != null)
|
||||||
{
|
{
|
||||||
DatagramSocket udpSocket = hostSocket.getUDPSocket();
|
DatagramSocket udpSocket = hostSocket.getUDPSocket();
|
||||||
DatagramSocket udpStunSocket = null;
|
DatagramSocket udpStunSocket = null;
|
||||||
|
|||||||
@ -397,7 +397,7 @@ public class HostCandidateHarvester
|
|||||||
* @param minPort the port number where we should first try to bind before
|
* @param minPort the port number where we should first try to bind before
|
||||||
* moving to the next one (i.e. <tt>minPort + 1</tt>)
|
* moving to the next one (i.e. <tt>minPort + 1</tt>)
|
||||||
* @param maxPort the maximum port number where we should try binding
|
* @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>.
|
* @return the newly created <tt>DatagramSocket</tt>.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class MultiplexingDatagramSocket
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The indicator which determines whether this <tt>DatagramSocket</tt> is
|
* The indicator which determines whether this <tt>DatagramSocket</tt> is
|
||||||
* currently reading from the network using
|
* currently reading from the network using
|
||||||
* {@link DatagramSocket#receive(DatagramPacket)}. When <tt>true</tt>,
|
* {@link DatagramSocket#receive(DatagramPacket)}. When <tt>true</tt>,
|
||||||
* subsequent requests to read from the network will be blocked until the
|
* subsequent requests to read from the network will be blocked until the
|
||||||
* current read is finished.
|
* current read is finished.
|
||||||
@ -89,7 +89,7 @@ public class MultiplexingDatagramSocket
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Buffer variable for storing the SO_TIMEOUT value set by the
|
* Buffer variable for storing the SO_TIMEOUT value set by the
|
||||||
* last <tt>setSoTimeout()</tt> call. Altough not strictly needed,
|
* last <tt>setSoTimeout()</tt> call. Although not strictly needed,
|
||||||
* getting the locally stored value as opposed to retrieving it
|
* getting the locally stored value as opposed to retrieving it
|
||||||
* from a parent <tt>getSoTimeout()</tt> call seems to
|
* from a parent <tt>getSoTimeout()</tt> call seems to
|
||||||
* significantly improve efficiency, at least on some platforms.
|
* significantly improve efficiency, at least on some platforms.
|
||||||
@ -99,7 +99,7 @@ public class MultiplexingDatagramSocket
|
|||||||
/**
|
/**
|
||||||
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
||||||
* to enable <tt>DatagramPacket</tt> filtering and binds it to any available
|
* to enable <tt>DatagramPacket</tt> filtering and binds it to any available
|
||||||
* port on the local host machine. The socket will be bound to the wildcard
|
* port on the local host machine. The socket will be bound to the wildcard
|
||||||
* address, an IP address chosen by the kernel.
|
* address, an IP address chosen by the kernel.
|
||||||
*
|
*
|
||||||
* @throws SocketException if the socket could not be opened, or the socket
|
* @throws SocketException if the socket could not be opened, or the socket
|
||||||
@ -131,7 +131,7 @@ public class MultiplexingDatagramSocket
|
|||||||
/**
|
/**
|
||||||
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
||||||
* to enable <tt>DatagramPacket</tt> filtering and binds it to the specified
|
* to enable <tt>DatagramPacket</tt> filtering and binds it to the specified
|
||||||
* port on the local host machine. The socket will be bound to the wildcard
|
* port on the local host machine. The socket will be bound to the wildcard
|
||||||
* address, an IP address chosen by the kernel.
|
* address, an IP address chosen by the kernel.
|
||||||
*
|
*
|
||||||
* @param port the port to bind the new socket to
|
* @param port the port to bind the new socket to
|
||||||
@ -148,7 +148,7 @@ public class MultiplexingDatagramSocket
|
|||||||
/**
|
/**
|
||||||
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
* Initializes a new <tt>MultiplexingDatagramSocket</tt> instance which is
|
||||||
* to enable <tt>DatagramPacket</tt> filtering, bound to the specified local
|
* to enable <tt>DatagramPacket</tt> filtering, bound to the specified local
|
||||||
* address. The local port must be between 0 and 65535 inclusive. If the IP
|
* address. The local port must be between 0 and 65535 inclusive. If the IP
|
||||||
* address is 0.0.0.0, the socket will be bound to the wildcard address, an
|
* address is 0.0.0.0, the socket will be bound to the wildcard address, an
|
||||||
* IP address chosen by the kernel.
|
* IP address chosen by the kernel.
|
||||||
*
|
*
|
||||||
@ -386,7 +386,7 @@ public class MultiplexingDatagramSocket
|
|||||||
public void receive(DatagramPacket p)
|
public void receive(DatagramPacket p)
|
||||||
throws SocketTimeoutException, IOException
|
throws SocketTimeoutException, IOException
|
||||||
{
|
{
|
||||||
receive(received, p, soTimeout);
|
receive(received, p, soTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -402,23 +402,25 @@ public class MultiplexingDatagramSocket
|
|||||||
* @param p the <tt>DatagramPacket</tt> into which to place the incoming
|
* @param p the <tt>DatagramPacket</tt> into which to place the incoming
|
||||||
* data
|
* data
|
||||||
* @param timeout the maximum time in milliseconds to wait for a
|
* @param timeout the maximum time in milliseconds to wait for a
|
||||||
* packet. A timeout of zero is interpreted as an infinite
|
* packet. A timeout of zero is interpreted as an infinite
|
||||||
* timeout
|
* timeout
|
||||||
* @throws SocketTimeoutException if the timeout has expired
|
* @throws SocketTimeoutException if the timeout has expired
|
||||||
* @throws IOException if an I/O error occurs
|
* @throws IOException if an I/O error occurs
|
||||||
*/
|
*/
|
||||||
private void receive(List<DatagramPacket> received, DatagramPacket p,
|
private void receive(
|
||||||
int timeout)
|
List<DatagramPacket> received,
|
||||||
|
DatagramPacket p,
|
||||||
|
int timeout)
|
||||||
throws SocketTimeoutException, IOException
|
throws SocketTimeoutException, IOException
|
||||||
{
|
{
|
||||||
long now, start = System.currentTimeMillis();
|
long now, start = System.currentTimeMillis();
|
||||||
DatagramPacket r = null;
|
DatagramPacket r = null;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
now = System.currentTimeMillis();
|
now = System.currentTimeMillis();
|
||||||
if (timeout > 0 && now - start >= timeout)
|
if (timeout > 0 && now - start >= timeout)
|
||||||
throw new SocketTimeoutException("Socket timeout");
|
throw new SocketTimeoutException("Socket timeout");
|
||||||
|
|
||||||
synchronized (received)
|
synchronized (received)
|
||||||
{
|
{
|
||||||
@ -455,9 +457,10 @@ public class MultiplexingDatagramSocket
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
received.wait((timeout > 0 ?
|
received.wait(
|
||||||
timeout - (now - start) :
|
timeout > 0
|
||||||
1000));
|
? timeout - (now - start)
|
||||||
|
: 1000);
|
||||||
}
|
}
|
||||||
catch (InterruptedException ie)
|
catch (InterruptedException ie)
|
||||||
{
|
{
|
||||||
@ -583,10 +586,10 @@ public class MultiplexingDatagramSocket
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSoTimeout(int timeout)
|
public void setSoTimeout(int timeout)
|
||||||
throws SocketException
|
throws SocketException
|
||||||
{
|
{
|
||||||
super.setSoTimeout(timeout);
|
super.setSoTimeout(timeout);
|
||||||
soTimeout = timeout;
|
soTimeout = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user