Handles TCP socket when closed by remote host (which previously triggers numerous illegal length excpetion).

This commit is contained in:
chenzo 2012-08-21 14:13:32 +00:00
parent 757aef02d4
commit 139ac8a12f

View File

@ -888,8 +888,8 @@ public class DelegatingSocket
// hole punch packet.
if(fb == -1 || sb == -1)
{
p.setLength(-1);
return;
p.setLength(0);
throw new SocketException("read failed");
}
int desiredLength = (((fb & 0xff) << 8) | (sb & 0xff));