diff --git a/TLSharp.Core/Network/TcpTransport.cs b/TLSharp.Core/Network/TcpTransport.cs index e0f6e1f..b33b384 100644 --- a/TLSharp.Core/Network/TcpTransport.cs +++ b/TLSharp.Core/Network/TcpTransport.cs @@ -16,10 +16,11 @@ namespace TLSharp.Core.Network { if (handler == null) { - _tcpClient = new TcpClient(); - var ipAddress = IPAddress.Parse(address); - _tcpClient.Connect(ipAddress, port); + var endpoint = new IPEndPoint(ipAddress, port); + + _tcpClient = new TcpClient(endpoint); + _tcpClient.Connect(endpoint); } else _tcpClient = handler(address, port);