diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index 19b3af8..9d48fd7 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -131,7 +131,7 @@ public class Agent = "IceProcessingState"; /** - * the value of Ta as specified by the application or -1 + * The value of Ta as specified by the application or -1 * if non was specified and we should calculate one ourselves. */ private long taValue = -1; diff --git a/src/org/ice4j/ice/LocalCandidate.java b/src/org/ice4j/ice/LocalCandidate.java index d3df6af..e6ab344 100644 --- a/src/org/ice4j/ice/LocalCandidate.java +++ b/src/org/ice4j/ice/LocalCandidate.java @@ -122,7 +122,7 @@ public abstract class LocalCandidate { IceSocketWrapper hostSocket = getIceSocketWrapper(); - if(hostSocket.getTCPSocket() != null) + if (hostSocket.getTCPSocket() != null) { Socket tcpSocket = hostSocket.getTCPSocket(); Socket tcpStunSocket = null; @@ -178,7 +178,7 @@ public abstract class LocalCandidate return stunSocket; } - else if(hostSocket.getUDPSocket() != null) + else if (hostSocket.getUDPSocket() != null) { DatagramSocket udpSocket = hostSocket.getUDPSocket(); DatagramSocket udpStunSocket = null; diff --git a/src/org/ice4j/ice/harvest/HostCandidateHarvester.java b/src/org/ice4j/ice/harvest/HostCandidateHarvester.java index 0d5af99..7d93f0d 100644 --- a/src/org/ice4j/ice/harvest/HostCandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/HostCandidateHarvester.java @@ -397,7 +397,7 @@ public class HostCandidateHarvester * @param minPort the port number where we should first try to bind before * moving to the next one (i.e. minPort + 1) * @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 DatagramSocket. * diff --git a/src/org/ice4j/socket/MultiplexingDatagramSocket.java b/src/org/ice4j/socket/MultiplexingDatagramSocket.java index 9905764..b52d401 100644 --- a/src/org/ice4j/socket/MultiplexingDatagramSocket.java +++ b/src/org/ice4j/socket/MultiplexingDatagramSocket.java @@ -42,7 +42,7 @@ public class MultiplexingDatagramSocket /** * The indicator which determines whether this DatagramSocket is - * currently reading from the network using + * currently reading from the network using * {@link DatagramSocket#receive(DatagramPacket)}. When true, * subsequent requests to read from the network will be blocked until the * current read is finished. @@ -89,7 +89,7 @@ public class MultiplexingDatagramSocket /** * Buffer variable for storing the SO_TIMEOUT value set by the - * last setSoTimeout() call. Altough not strictly needed, + * last setSoTimeout() call. Although not strictly needed, * getting the locally stored value as opposed to retrieving it * from a parent getSoTimeout() call seems to * significantly improve efficiency, at least on some platforms. @@ -99,7 +99,7 @@ public class MultiplexingDatagramSocket /** * Initializes a new MultiplexingDatagramSocket instance which is * to enable DatagramPacket 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. * * @throws SocketException if the socket could not be opened, or the socket @@ -131,7 +131,7 @@ public class MultiplexingDatagramSocket /** * Initializes a new MultiplexingDatagramSocket instance which is * to enable DatagramPacket 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. * * @param port the port to bind the new socket to @@ -148,7 +148,7 @@ public class MultiplexingDatagramSocket /** * Initializes a new MultiplexingDatagramSocket instance which is * to enable DatagramPacket 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 * IP address chosen by the kernel. * @@ -386,7 +386,7 @@ public class MultiplexingDatagramSocket public void receive(DatagramPacket p) throws SocketTimeoutException, IOException { - receive(received, p, soTimeout); + receive(received, p, soTimeout); } /** @@ -402,23 +402,25 @@ public class MultiplexingDatagramSocket * @param p the DatagramPacket into which to place the incoming * data * @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 * @throws SocketTimeoutException if the timeout has expired * @throws IOException if an I/O error occurs */ - private void receive(List received, DatagramPacket p, - int timeout) + private void receive( + List 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"); synchronized (received) { @@ -455,9 +457,10 @@ public class MultiplexingDatagramSocket { try { - received.wait((timeout > 0 ? - timeout - (now - start) : - 1000)); + received.wait( + timeout > 0 + ? timeout - (now - start) + : 1000); } catch (InterruptedException ie) { @@ -583,10 +586,10 @@ public class MultiplexingDatagramSocket */ @Override public void setSoTimeout(int timeout) - throws SocketException + throws SocketException { - super.setSoTimeout(timeout); - soTimeout = timeout; + super.setSoTimeout(timeout); + soTimeout = timeout; } /**