Corrects reception of hole punch packets for TCP socket.
This commit is contained in:
parent
5434a8ab41
commit
525d7e14d1
@ -838,8 +838,10 @@ public class DelegatingSocket
|
|||||||
int fb = inputStream.read();
|
int fb = inputStream.read();
|
||||||
int sb = 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)
|
if(fb == -1 || sb == -1)
|
||||||
throw new SocketException("failed to read first two bytes");
|
return;
|
||||||
|
|
||||||
int desiredLength = (((fb & 0xff) << 8) | (sb & 0xff));
|
int desiredLength = (((fb & 0xff) << 8) | (sb & 0xff));
|
||||||
int readLen = 0;
|
int readLen = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user