mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Re-enabled IPv6, and fixed TcpClient to work with IPv6 addresses, per feedback from #853
This commit is contained in:
parent
eae4ed68c0
commit
6094bcedf5
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace TLSharp.Core
|
|||
exported = await SendRequestAsync<TLExportedAuthorization>(exportAuthorization);
|
||||
}
|
||||
|
||||
var dc = dcOptions.First(d => d.Id == dcId && !d.Ipv6);
|
||||
var dc = dcOptions.First(d => d.Id == dcId);
|
||||
var dataCenter = new DataCenter (dcId, dc.IpAddress, dc.Port);
|
||||
|
||||
_transport = new TcpTransport(dc.IpAddress, dc.Port, _handler);
|
||||
|
|
|
|||
Loading…
Reference in a new issue