mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-09 23:25:42 +00:00
fix: read handshake response explicitly
This commit is contained in:
parent
bf7f14acac
commit
19c83b14a1
@ -95,8 +95,9 @@ public sealed class ProtocolClient : ClientNode
|
||||
|
||||
State = ClientState.Handshaking;
|
||||
var handshakeRequest = new HandshakeRequestPacket(ProtocolVersion);
|
||||
var handshakeResponse = await SendAndReceiveAsync<HandshakeResponsePacket>(handshakeRequest, cancellationToken);
|
||||
await SendPacketAsync(handshakeRequest, cancellationToken);
|
||||
|
||||
var handshakeResponse = await WaitForPacketAsync<HandshakeResponsePacket>(cancellationToken);
|
||||
if (handshakeResponse.HandshakeResponse != HandshakeResponse.Success)
|
||||
{
|
||||
Close();
|
||||
|
Loading…
Reference in New Issue
Block a user