diff --git a/TcpDotNet.ClientIntegrationTest/PacketHandlers/GoodbyePacketHandler.cs b/TcpDotNet.ClientIntegrationTest/PacketHandlers/GoodbyePacketHandler.cs index 243aa78..5277031 100644 --- a/TcpDotNet.ClientIntegrationTest/PacketHandlers/GoodbyePacketHandler.cs +++ b/TcpDotNet.ClientIntegrationTest/PacketHandlers/GoodbyePacketHandler.cs @@ -4,7 +4,7 @@ namespace TcpDotNet.ClientIntegrationTest.PacketHandlers; internal sealed class GoodbyePacketHandler : PacketHandler { - public override Task HandleAsync(BaseClientNode recipient, GoodbyePacket packet, CancellationToken cancellationToken = default) + public override Task HandleAsync(ClientNode recipient, GoodbyePacket packet, CancellationToken cancellationToken = default) { Console.WriteLine($"Server sent {packet.Message}"); return Task.CompletedTask; diff --git a/TcpDotNet.ListenerIntegrationTest/PacketHandlers/HelloPacketHandler.cs b/TcpDotNet.ListenerIntegrationTest/PacketHandlers/HelloPacketHandler.cs index f181fea..20646a0 100644 --- a/TcpDotNet.ListenerIntegrationTest/PacketHandlers/HelloPacketHandler.cs +++ b/TcpDotNet.ListenerIntegrationTest/PacketHandlers/HelloPacketHandler.cs @@ -4,7 +4,7 @@ namespace TcpDotNet.ListenerIntegrationTest.PacketHandlers; internal sealed class HelloPacketHandler : PacketHandler { - public override Task HandleAsync(BaseClientNode recipient, HelloPacket packet, CancellationToken cancellationToken = default) + public override Task HandleAsync(ClientNode recipient, HelloPacket packet, CancellationToken cancellationToken = default) { Console.WriteLine($"Client sent {packet.Message}"); return recipient.SendPacketAsync(new GoodbyePacket {Message = "Goodbye!"}, cancellationToken); diff --git a/TcpDotNet.ListenerIntegrationTest/Program.cs b/TcpDotNet.ListenerIntegrationTest/Program.cs index 8f88848..b0a3829 100644 --- a/TcpDotNet.ListenerIntegrationTest/Program.cs +++ b/TcpDotNet.ListenerIntegrationTest/Program.cs @@ -16,7 +16,7 @@ await Task.Delay(-1); internal sealed class PingPacketHandler : PacketHandler { - public override async Task HandleAsync(BaseClientNode recipient, PingPacket packet, CancellationToken cancellationToken = default) + public override async Task HandleAsync(ClientNode recipient, PingPacket packet, CancellationToken cancellationToken = default) { Console.WriteLine($"Client {recipient.SessionId} sent ping with payload {BitConverter.ToString(packet.Payload)}"); var pong = new PongPacket(packet.CallbackId, packet.Payload); diff --git a/TcpDotNet/BaseClientNode.cs b/TcpDotNet/ClientNode.cs similarity index 98% rename from TcpDotNet/BaseClientNode.cs rename to TcpDotNet/ClientNode.cs index c1df784..546dcb3 100644 --- a/TcpDotNet/BaseClientNode.cs +++ b/TcpDotNet/ClientNode.cs @@ -13,16 +13,16 @@ namespace TcpDotNet; /// /// Represents a client node. /// -public abstract class BaseClientNode : Node +public abstract class ClientNode : Node { private readonly ObjectIDGenerator _callbackIdGenerator = new(); private readonly ConcurrentDictionary>> _packetCompletionSources = new(); private EndPoint? _remoteEP; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - protected BaseClientNode() + protected ClientNode() { } diff --git a/TcpDotNet/ClientState.cs b/TcpDotNet/ClientState.cs index 01532ba..7fe88b8 100644 --- a/TcpDotNet/ClientState.cs +++ b/TcpDotNet/ClientState.cs @@ -1,7 +1,7 @@ namespace TcpDotNet; /// -/// An enumeration of states for a to be in. +/// An enumeration of states for a to be in. /// public enum ClientState { diff --git a/TcpDotNet/Protocol/PacketHandler.cs b/TcpDotNet/Protocol/PacketHandler.cs index c303e27..825363f 100644 --- a/TcpDotNet/Protocol/PacketHandler.cs +++ b/TcpDotNet/Protocol/PacketHandler.cs @@ -12,7 +12,7 @@ public abstract class PacketHandler /// The recipient of the packet. /// The packet to handle. /// A cancellation token that can be used to cancel the asynchronous operation. - public abstract Task HandleAsync(BaseClientNode recipient, Packet packet, CancellationToken cancellationToken = default); + public abstract Task HandleAsync(ClientNode recipient, Packet packet, CancellationToken cancellationToken = default); } /// @@ -27,7 +27,7 @@ public abstract class PacketHandler : PacketHandler public static readonly PacketHandler Empty = new NullPacketHandler(); /// - public override Task HandleAsync(BaseClientNode recipient, Packet packet, CancellationToken cancellationToken = default) + public override Task HandleAsync(ClientNode recipient, Packet packet, CancellationToken cancellationToken = default) { if (packet is T actual) return HandleAsync(recipient, actual, cancellationToken); return Task.CompletedTask; @@ -39,7 +39,7 @@ public abstract class PacketHandler : PacketHandler /// The recipient of the packet. /// The packet to handle. /// A cancellation token that can be used to cancel the asynchronous operation. - public abstract Task HandleAsync(BaseClientNode recipient, T packet, CancellationToken cancellationToken = default); + public abstract Task HandleAsync(ClientNode recipient, T packet, CancellationToken cancellationToken = default); } /// @@ -50,7 +50,7 @@ internal sealed class NullPacketHandler : PacketHandler where T : Packet { /// - public override Task HandleAsync(BaseClientNode recipient, T packet, CancellationToken cancellationToken = default) + public override Task HandleAsync(ClientNode recipient, T packet, CancellationToken cancellationToken = default) { return Task.CompletedTask; } diff --git a/TcpDotNet/Protocol/PacketHandlers/DisconnectPacketHandler.cs b/TcpDotNet/Protocol/PacketHandlers/DisconnectPacketHandler.cs index 0107ba9..ea9ce27 100644 --- a/TcpDotNet/Protocol/PacketHandlers/DisconnectPacketHandler.cs +++ b/TcpDotNet/Protocol/PacketHandlers/DisconnectPacketHandler.cs @@ -6,7 +6,7 @@ internal sealed class DisconnectPacketHandler : PacketHandler { /// public override Task HandleAsync( - BaseClientNode recipient, + ClientNode recipient, DisconnectPacket packet, CancellationToken cancellationToken = default ) diff --git a/TcpDotNet/Protocol/PacketHandlers/EncryptionResponsePacketHandler.cs b/TcpDotNet/Protocol/PacketHandlers/EncryptionResponsePacketHandler.cs index c79914a..0a6194a 100644 --- a/TcpDotNet/Protocol/PacketHandlers/EncryptionResponsePacketHandler.cs +++ b/TcpDotNet/Protocol/PacketHandlers/EncryptionResponsePacketHandler.cs @@ -11,7 +11,7 @@ internal sealed class EncryptionResponsePacketHandler : PacketHandler public override async Task HandleAsync( - BaseClientNode recipient, + ClientNode recipient, EncryptionResponsePacket packet, CancellationToken cancellationToken = default ) diff --git a/TcpDotNet/Protocol/PacketHandlers/HandshakeRequestPacketHandler.cs b/TcpDotNet/Protocol/PacketHandlers/HandshakeRequestPacketHandler.cs index 2df88d0..9ec2a75 100644 --- a/TcpDotNet/Protocol/PacketHandlers/HandshakeRequestPacketHandler.cs +++ b/TcpDotNet/Protocol/PacketHandlers/HandshakeRequestPacketHandler.cs @@ -10,7 +10,7 @@ internal sealed class HandshakeRequestPacketHandler : PacketHandler public override async Task HandleAsync( - BaseClientNode recipient, + ClientNode recipient, HandshakeRequestPacket packet, CancellationToken cancellationToken = default ) diff --git a/TcpDotNet/ProtocolClient.cs b/TcpDotNet/ProtocolClient.cs index ff9979b..e510ca3 100644 --- a/TcpDotNet/ProtocolClient.cs +++ b/TcpDotNet/ProtocolClient.cs @@ -14,7 +14,7 @@ namespace TcpDotNet; /// /// Represents a client on the TcpDotNet protocol. /// -public sealed class ProtocolClient : BaseClientNode +public sealed class ProtocolClient : ClientNode { /// /// Initializes a new instance of the class. diff --git a/TcpDotNet/ProtocolListener.Client.cs b/TcpDotNet/ProtocolListener.Client.cs index 2755a31..3c834c4 100644 --- a/TcpDotNet/ProtocolListener.Client.cs +++ b/TcpDotNet/ProtocolListener.Client.cs @@ -8,7 +8,7 @@ public sealed partial class ProtocolListener /// /// Represents a client that is connected to a . /// - public sealed class Client : BaseClientNode + public sealed class Client : ClientNode { internal Client(ProtocolListener listener, Socket socket) {