We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
改进点:
新建连接,上行:
新建连接时,客户端先发送一个全0的字节告知服务端这是一个新连接
接着客户端发送8个字节的握手请求
PublicKey为DH密钥交换用的公钥
type HandshakeRequest struct { PublicKey uint64 }
新建连接,下行:
当服务端收到新建连接请求后,下发16个字节的握手响应
CryptedConnID为加密后的连接ID,加密所需密钥通过DH密钥交换算法计算得出
type HandshakeResponse struct { PublicKey uint64 CryptedConnID uint64 }
重连,上行:
当客户端尝试重连时,新建一个TCP/IP连接,并发送一个全1的字节告知服务端这是一个重连
接着客户端40个字节的重连请求
ConnID为连接ID
WriteCount为客户端已发送字节数
ReadCount为客户端已接收字节数
MD5Hash为消息前24个字节加通讯密钥计算得出的MD5哈希值
type ReconnRequest struct { ConnID uint64 WriteCount uint64 ReadCount uint64 MD5Hash [16]byte }
重连,下行:
当服务端接收到重连请求时,对连接的合法性进行验证
服务端下发16个字节的重连响应
验证失败:
验证成功:
紧接着服务端立即下发需要重传的数据
客户端在收到重连响应后,比较收发字节数差值来读取服务端下发的重传数据
type ReconnResponse struct { WriteCount uint64 ReadCount uint64 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
改进点:
新建连接,上行:
新建连接时,客户端先发送一个全0的字节告知服务端这是一个新连接
接着客户端发送8个字节的握手请求
PublicKey为DH密钥交换用的公钥
新建连接,下行:
当服务端收到新建连接请求后,下发16个字节的握手响应
PublicKey为DH密钥交换用的公钥
CryptedConnID为加密后的连接ID,加密所需密钥通过DH密钥交换算法计算得出
重连,上行:
当客户端尝试重连时,新建一个TCP/IP连接,并发送一个全1的字节告知服务端这是一个重连
接着客户端40个字节的重连请求
ConnID为连接ID
WriteCount为客户端已发送字节数
ReadCount为客户端已接收字节数
MD5Hash为消息前24个字节加通讯密钥计算得出的MD5哈希值
重连,下行:
当服务端接收到重连请求时,对连接的合法性进行验证
服务端下发16个字节的重连响应
验证失败:
验证成功:
紧接着服务端立即下发需要重传的数据
客户端在收到重连响应后,比较收发字节数差值来读取服务端下发的重传数据
The text was updated successfully, but these errors were encountered: