Added some TCP wrapper classes for testability
This commit is contained in:
32
AMWD.Protocols.Modbus.Tcp/Utils/IPEndPointWrapper.cs
Normal file
32
AMWD.Protocols.Modbus.Tcp/Utils/IPEndPointWrapper.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Net;
|
||||
|
||||
namespace AMWD.Protocols.Modbus.Tcp.Utils
|
||||
{
|
||||
internal class IPEndPointWrapper
|
||||
{
|
||||
private IPEndPoint _ipEndPoint;
|
||||
|
||||
public IPEndPointWrapper(EndPoint endPoint)
|
||||
{
|
||||
_ipEndPoint = (IPEndPoint)endPoint;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <inheritdoc cref="IPEndPoint.Address"/>
|
||||
public virtual IPAddress Address
|
||||
{
|
||||
get => _ipEndPoint.Address;
|
||||
set => _ipEndPoint.Address = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IPEndPoint.Port"/>
|
||||
public virtual int Port
|
||||
{
|
||||
get => _ipEndPoint.Port;
|
||||
set => _ipEndPoint.Port = value;
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user