mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Add connection timeout using server keepalives
Vanilla client will consider that connection has been lost when no server keepalive was received during the last 30 seconds. This commit implements a similar mechanism in MCC. See #802
This commit is contained in:
parent
1406c00abd
commit
877e50579d
4 changed files with 61 additions and 6 deletions
|
|
@ -83,6 +83,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
case 0x00: byte[] keepalive = new byte[5] { 0, 0, 0, 0, 0 };
|
||||
Receive(keepalive, 1, 4, SocketFlags.None);
|
||||
handler.OnServerKeepAlive();
|
||||
Send(keepalive); break;
|
||||
case 0x01: readData(4); readNextString(); readData(5); break;
|
||||
case 0x02: readData(1); readNextString(); readNextString(); readData(4); break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue