2023-06-21 06:28:40 +00:00
|
|
|
|
namespace Utils
|
|
|
|
|
{
|
|
|
|
|
public class Address
|
|
|
|
|
{
|
|
|
|
|
public Address(string host, int port)
|
|
|
|
|
{
|
|
|
|
|
Host = host;
|
|
|
|
|
Port = port;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Host { get; }
|
|
|
|
|
public int Port { get; }
|
2023-10-19 09:18:59 +00:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"{Host}:{Port}";
|
|
|
|
|
}
|
2023-10-23 13:28:20 +00:00
|
|
|
|
|
|
|
|
|
public bool IsValid()
|
|
|
|
|
{
|
|
|
|
|
return !string.IsNullOrEmpty(Host) && Port > 0;
|
|
|
|
|
}
|
2023-06-21 06:28:40 +00:00
|
|
|
|
}
|
|
|
|
|
}
|