2024-02-12 17:41:52 +00:00
|
|
|
using TcpDotNet.Protocol;
|
2022-07-05 14:55:59 +01:00
|
|
|
|
|
|
|
namespace TcpDotNet.ListenerIntegrationTest.PacketHandlers;
|
|
|
|
|
|
|
|
internal sealed class HelloPacketHandler : PacketHandler<HelloPacket>
|
|
|
|
{
|
2024-02-12 17:32:29 +00:00
|
|
|
public override Task HandleAsync(ClientNode recipient, HelloPacket packet, CancellationToken cancellationToken = default)
|
2022-07-05 14:55:59 +01:00
|
|
|
{
|
|
|
|
Console.WriteLine($"Client sent {packet.Message}");
|
2023-01-22 14:41:14 +00:00
|
|
|
return recipient.SendPacketAsync(new GoodbyePacket {Message = "Goodbye!"}, cancellationToken);
|
2022-07-05 14:55:59 +01:00
|
|
|
}
|
|
|
|
}
|