1
0
mirror of https://github.com/oliverbooth/TcpDotNet synced 2024-11-10 05:35:41 +00:00
TcpDotNet/TcpDotNet.ListenerIntegrationTest/PacketHandlers/HelloPacketHandler.cs

13 lines
466 B
C#
Raw Normal View History

2022-07-05 14:55:59 +01:00
using TcpDotNet.Protocol;
namespace TcpDotNet.ListenerIntegrationTest.PacketHandlers;
internal sealed class HelloPacketHandler : PacketHandler<HelloPacket>
{
public override Task HandleAsync(BaseClientNode recipient, HelloPacket packet, CancellationToken cancellationToken = default)
{
Console.WriteLine($"Client sent {packet.Message}");
return recipient.SendPacketAsync(new GoodbyePacket {Message = "Nope"}, cancellationToken);
}
}