Modified TcpClient setup to work with IPv6 addresses, fixing #773.

This commit is contained in:
Nicholas Rodine 2019-06-27 09:50:05 -04:00 committed by Afshin Arani
parent d6d2553c0f
commit 4ea9879f0e

View file

@ -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);