Check-in Source

Signed-off-by: mharb <mharb@noreply.localhost>
This commit is contained in:
2025-08-02 19:40:09 -04:00
parent b9cf975de8
commit 80d6e912ab
5 changed files with 177 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using System;
using System.Net.Sockets;
using static System.Console;
namespace ProtosXdigitalDemo
{
internal class TcpClientConnector
{
private readonly string _ip;
private readonly int _port;
public TcpClientConnector(string ip, int port)
{
_ip = ip;
_port = port;
}
public TcpClient Connect()
{
try
{
return new TcpClient(_ip, _port);
}
catch (Exception ex)
{
WriteLine($"[Error] Unable to connect to {_ip}:{_port} → {ex.Message}");
throw;
}
}
}
}