Open 3webmaster opened 6 years ago
Same here, I post my exception here https://github.com/sochix/TLSharp/issues/709
It throws that exception from time to time.
I found the issue to my problem (might not apply to you). I am using Azure function to run my program and sometimes they would save the state on file storage, and rerun later on.
This timeout error will happen when TelegramClient is deserialized and run again.
TelegramClient cannot establish connection in ASP.MVC. I use the standard code:
This code works in console applications, but not it ASP.MVC. Here is the error message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 149.154.175.100:443 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 149.154.175.100:443
SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 149.154.175.100:443] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +244 System.Net.Sockets.Socket.Connect(EndPoint remoteEP) +150 System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP) +83 System.Net.Sockets.TcpClient.Connect(IPAddress address, Int32 port) +142 TLSharp.Core.Network.TcpTransport..ctor(String address, Int32 port, TcpClientConnectionHandler handler) +222 TLSharp.Core.TelegramClient..ctor(Int32 apiId, String apiHash, ISessionStore store, String sessionUserId, TcpClientConnectionHandler handler) +601 CommonClasses.<Register>d__0.MoveNext() in D:\Projects\Telegram\CommonClasses\Methods.cs:25 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60 System.Runtime.CompilerServices.TaskAwaiter.GetResult() +28 Web.Controllers.MainController.Home() in D:\Projects\Telegram\Web\Controllers\MainController.cs:15 lambda_method(Closure , ControllerBase , Object[] ) +87 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
2 parameters) +229 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +35 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39 System.Web.Mvc.Async.WrappedAsyncResult
2.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.AsyncInvocationWithFilters.1.CallEndDelegate(IAsyncResult asyncResult) +68 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38 System.Web.Mvc.MvcHandler.1.CallEndDelegate(IAsyncResult asyncResult) +68 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128