mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-10 02:55:41 +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;
|
State = ClientState.Handshaking;
|
||||||
var handshakeRequest = new HandshakeRequestPacket(ProtocolVersion);
|
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)
|
if (handshakeResponse.HandshakeResponse != HandshakeResponse.Success)
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
|
Loading…
Reference in New Issue
Block a user