diff --git a/src/org/ice4j/socket/DelegatingSocket.java b/src/org/ice4j/socket/DelegatingSocket.java index d081185..9c8e66c 100644 --- a/src/org/ice4j/socket/DelegatingSocket.java +++ b/src/org/ice4j/socket/DelegatingSocket.java @@ -838,8 +838,10 @@ public class DelegatingSocket int fb = inputStream.read(); int sb = inputStream.read(); + // If we do not achieve to read the first bytes, then it was just an + // hole punch packet. if(fb == -1 || sb == -1) - throw new SocketException("failed to read first two bytes"); + return; int desiredLength = (((fb & 0xff) << 8) | (sb & 0xff)); int readLen = 0;