sochix / TLSharp

Telegram client library implemented in C#
1k stars 380 forks source link

System.Net.Sockets.SocketException #817

Closed kensonlai28 closed 5 years ago

kensonlai28 commented 5 years ago

When I run the following code:

var hash = await client.SendCodeRequestAsync("");

I got the following error:

System.Net.Sockets.SocketException HResult=0x80004005 Message=An address incompatible with the requested protocol was used [2001:b28:f23f:f005::a]:443 Source=System StackTrace: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP) at System.Net.Sockets.TcpClient.Connect(IPAddress address, Int32 port) at TLSharp.Core.Network.TcpTransport..ctor(String address, Int32 port, TcpClientConnectionHandler handler) at TLSharp.Core.TelegramClient.d10.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at TLSharp.Core.TelegramClient.d11.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at TLSharp.Core.TelegramClient.d__14.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at WindowsFormsApp1.telegramPhone.d__2.MoveNext() in C:\TransferToServer\WindowsFormsApp1\WindowsFormsApp1\telegramPhone.cs:line 32

How should I fix this?

Regards.

phuongnv9 commented 5 years ago

Hello. I'm having a similar error, please give me a solution