using System.Net.Sockets;

namespace Forwarder.Services.Implementations.NetworkSenders;

/// <summary>
/// Отправляет сообщения по TCP.
/// </summary>
/// <param name="networkStream">UDP-клиент.</param>
internal class TcpNetworkSender(
	NetworkStream networkStream
) : INetworkSender
{
	/// <inheritdoc />
	public async Task SendAsync(byte[] message, CancellationToken cancellationToken)
	{
		await networkStream.WriteAsync(
			message,
			cancellationToken
		);
	}
}