mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-09 23:05:41 +00:00
13 lines
470 B
C#
13 lines
470 B
C#
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 = "Goodbye!"}, cancellationToken);
|
|
}
|
|
}
|