diff --git a/TcpDotNet/ProtocolClient.cs b/TcpDotNet/ProtocolClient.cs index d6a32bc..98547d5 100644 --- a/TcpDotNet/ProtocolClient.cs +++ b/TcpDotNet/ProtocolClient.cs @@ -95,8 +95,9 @@ public sealed class ProtocolClient : ClientNode State = ClientState.Handshaking; var handshakeRequest = new HandshakeRequestPacket(ProtocolVersion); - var handshakeResponse = await SendAndReceiveAsync(handshakeRequest, cancellationToken); + await SendPacketAsync(handshakeRequest, cancellationToken); + var handshakeResponse = await WaitForPacketAsync(cancellationToken); if (handshakeResponse.HandshakeResponse != HandshakeResponse.Success) { Close();