private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }
private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } } }
private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } }
private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }
private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } }
private void calculateMaxBytesPerGatheringWrite() { // Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide. int newSendBufferSize = getSendBufferSize() << 1; if (newSendBufferSize > 0) { setMaxBytesPerGatheringWrite(getSendBufferSize() << 1); } }
private void adjustMaxBytesPerGatheringWrite(int attempted, int written, int oldMaxBytesPerGatheringWrite) { // By default we track the SO_SNDBUF when ever it is explicitly set. However some OSes may dynamically change // SO_SNDBUF (and other characteristics that determine how much data can be written at once) so we should try // make a best effort to adjust as OS behavior changes. if (attempted == written) { if (attempted << 1 > oldMaxBytesPerGatheringWrite) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted << 1); } } else if (attempted > MAX_BYTES_PER_GATHERING_WRITE_ATTEMPTED_LOW_THRESHOLD && written < attempted >>> 1) { ((NioSocketChannelConfig) config).setMaxBytesPerGatheringWrite(attempted >>> 1); } }