Archived
0

уменьшена скорость отдачи KeepAlive

This commit is contained in:
2021-05-09 16:59:20 +03:00
parent c6669af651
commit f10fb46d23
2 changed files with 27 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import java.util.Base64;
import java.util.Collections;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
@Slf4j
@RequiredArgsConstructor
@@ -44,7 +45,14 @@ public class PacketHandler {
}
public void onKeepAlivePlay(ConnectionContext context, PingPacket packet) {
context.sendNow(packet);
try {
TimeUnit.MILLISECONDS.sleep(50);
context.sendNow(packet);
} catch (InterruptedException e) {
if (log.isTraceEnabled()) {
log.trace("{}", e.getMessage(), e);
}
}
}
@SuppressWarnings("unused")