return windowSize;
}
private int calcChecksum(SocketBuffer skbuf, int offset) {
final IPv4Header ipHdr = (IPv4Header) skbuf.getNetworkLayerHeader();
final SocketBuffer phdr = new SocketBuffer(12);
phdr.insert(12);
ipHdr.getSource().writeTo(phdr, 0);
ipHdr.getDestination().writeTo(phdr, 4);
phdr.set(8, 0);
phdr.set(9, ipHdr.getProtocol());
phdr.set16(10, tcpLength + headerLength);
phdr.append(offset, skbuf);
final int csLength = headerLength + tcpLength + 12;
return IPv4Utils.calcChecksum(phdr, 0, csLength);
}