(@NotNull AsyncSocket so, long newSize, byte @NotNull [] bytes, int offset, int length)
| 571 | } |
| 572 | |
| 573 | @SuppressWarnings("RedundantThrows") |
| 574 | public boolean checkOverflow(@NotNull AsyncSocket so, long newSize, byte @NotNull [] bytes, int offset, int length) |
| 575 | throws Exception { |
| 576 | var maxSize = getSocketOptions().getOutputBufferMaxSize(); |
| 577 | if (newSize <= maxSize) |
| 578 | return true; |
| 579 | overflowSizeHandle.getAndAdd(this, (long)length); |
| 580 | if ((int)overflowCountHandle.getAndAdd(this, 1) == 0) { |
| 581 | Task.scheduleUnsafe(1000, () -> logger.error("Send overflow(>{}): {} dropped {}/{}", |
| 582 | maxSize, this, overflowSizeHandle.getAndSet(this, 0L), overflowCountHandle.getAndSet(this, 0))); |
| 583 | } |
| 584 | return false; |
| 585 | } |
| 586 | |
| 587 | //////////////////////////////////////////////////////////////////////////////////////////////// |
| 588 |
no test coverage detected