System.Net.Http.HttpRequestException for Send grid send email - c#

We are facing following exception in calling Sendgrid Send Email function in some case.
We get this exception for 20-30 emails out of 50,000 in a day.
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Unknown error (0xffffffff)
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SendGrid.Helpers.Reliability.RetryDelegatingHandler.<SendAsync>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SendGrid.BaseClient.<MakeRequest>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SendGrid.BaseClient.<RequestAsync>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SendGrid.BaseClient.<SendEmailAsync>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
My code to send email is
var client = new SendGridClient("API Key");
var response = await client.SendEmailAsync(message);
Can anyone please help me how can I add more verification to avoid such situation.

The Retry logic did work for me so far.
catch (Exception ex)
{
if (--retryMax == 0)
{
throw;
}
else
{
await Task.Delay(1000);
}
return null;
}

Related

How to catch the special ServiceStack exceptions "response.FlushAsync()" from ServiceStack.HttpResponseExtensionsInternal?

The inner exception is "The remote host closed the connection. The error code is 0x80070057."
They only happen in the product environment, it's not my code, so try catch can not help.
The UncaughtExceptionHandlers also can not catch it:
UncaughtExceptionHandlers.Add((req, res, operationName, ex) => {
if (ex is HttpException && ex.Message.StartsWith("The remote host closed the connection", StringComparison.InvariantCultureIgnoreCase)) {
res.EndRequest(true);
}
});
The stack trace:
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at System.IO.Stream.<>c.<BeginWriteInternal>b__46_0(Object )
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.IO.Stream.EndWrite(IAsyncResult asyncResult)
at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_1(Stream stream, IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ServiceStack.StreamExtensions.<WriteToAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at ServiceStack.BufferedExtensions.<FlushBufferIfAnyAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ServiceStack.Host.AspNet.AspNetResponse.<FlushAsync>d__40.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at ServiceStack.HttpResponseExtensionsInternal.<WriteToResponse>d__7.MoveNext()
loggerName: ServiceStack.HttpResponseExtensionsInternal
ServiceStack version: 5.7.0
Net Framework: 4.7.2
It happens too many times, so I want to ignore it.
How could do the trick with the internal async exception process?
You would need to filter out the error messages from ServiceStack.HttpResponseExtensionsInternal Type in your current logger implementation.

HttpRequestException in API call, depending on user

I've been scratching my head about this one for a bit, and I was hoping someone better at parsing error messages might be able to point me in the right direction.
I have a .NET console application which utilizes the Dropbox API. The affected code snippet is printed below. When I run the executable from my machine (in a folder, co-located with the Dropbox DLL) it connects fine and performs some lookup as intended. When another user on the same network runs it on their machine (similar settings), the HttpRequestException printed below is logged after 20 seconds (consistently). Additionally, if I wrap this as a service for testing and run it on a third machine, it runs as expected under my account user/pass, but logs the same error when run under another user/pass.
Can anyone with better eyes at parsing error messages help steer me toward the solution? Or does anyone have ideas as to what I might be missing? I appreciate any help, even shots in the dark.
var _AccessToken = [value]
//DropboxCertHelper.InitializeCertPinning();
var httpClient = new HttpClient(new WebRequestHandler { ReadWriteTimeout = 10000 })
{
Timeout = TimeSpan.FromMinutes(20)
};
try
{
var config = new DropboxClientConfig("MyApplication")
{
HttpClient = httpClient
};
var client = new DropboxClient(_AccessToken, config);
ListFolderResult listing = new ListFolderResult();
listing = await client.Files.ListFolderAsync(_AppPath, true);
foreach (var item in listing.Entries.Where(i => i.IsFolder))
{
Log(item.PathDisplay);
}
}
catch (Exception e)
{
Log(e);
}
And this is the logged error:
System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.Net.WebException: Unable to connect to the remote server
---> 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 162.125.7.7:443
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Dropbox.Api.DropboxRequestHandler.<RequestJsonString>d__2f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Dropbox.Api.DropboxRequestHandler.<RequestJsonStringWithRetry>d__1a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Dropbox.Api.DropboxRequestHandler.<Dropbox.Api.Stone.ITransport.SendRpcRequestAsync>d__5`3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MyApplication.Program.<MyMethod>d__6.MoveNext()

No connection is available to service this operation: ZRANGEBYSCORE redis

i'm getting this error always
asp.net core 2.0
StackExchange.Redis.StrongName 1.2.6
3 redis server 1 master 2 replica
reading from replica only and writing to master
initializing connection manager like this
public static class X
{
static string connectionString;
public static void InitializeConnectionString(string cnxString)
{
if (string.IsNullOrWhiteSpace(cnxString))
throw new ArgumentNullException(nameof(cnxString));
connectionString = cnxString;
}
private static readonly Lazy LazyConnection = new Lazy(() =>
{
var connection = ConnectionMultiplexer.Connect(connectionString);
connection.PreserveAsyncOrder = false;
return connection;
});
public static ConnectionMultiplexer SafeCoonect
{
get
{
return LazyConnection.Value;
}
}
}
StackExchange.Redis.RedisConnectionException: No connection is
available to service this operation: ZRANGEBYSCORE
xxxxx:day20171122:xxxx; It was not possible to connect to the redis
server(s); ConnectTimeout ---> System.AggregateException: One or more
errors occurred. (It was not possible to connect to the redis
server(s); ConnectTimeout) (It was not possible to connect to the
redis server(s); ConnectTimeout) (It was not possible to connect to
the redis server(s); ConnectTimeout) (It was not possible to connect
to the redis server(s); ConnectTimeout) --->
StackExchange.Redis.RedisConnectionException: It was not possible to
connect to the redis server(s); ConnectTimeout --- End of inner
exception stack trace --- --- End of inner exception stack trace ---
at
StackExchange.Redis.ConnectionMultiplexer.ThrowFailed[T](TaskCompletionSource`1
source, Exception unthrownException) in
x:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line
2000 --- End of stack trace from previous location where exception was
thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at y.d__12.MoveNext() in x:\x.cs:line 163 --- End of stack trace
from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at y.d__8.MoveNext() in x:\x.cs:line 70 --- End of stack trace
from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at z.d__14.MoveNext() in z:\z\z.cs:line 113 --- End of stack
trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at lambda_method(Closure , Object ) at
Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
at
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext
context) at
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State&
next, Scope& scope, Object& state, Boolean& isCompleted) at
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__22.MoveNext() ---
End of stack trace from previous location where exception was thrown
--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext
context) at
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next,
Scope& scope, Object& state, Boolean& isCompleted) at
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__17.MoveNext() ---
End of stack trace from previous location where exception was thrown
--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__15.MoveNext() ---
End of stack trace from previous location where exception was thrown
--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Session.SessionMiddleware.d__9.MoveNext() --- End
of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Microsoft.AspNetCore.Session.SessionMiddleware.d__9.MoveNext() --- End
of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.d__6.MoveNext()
This post is a bit old, but in case others run into it.
Github issues, list this as fixed in version 2.X
https://github.com/StackExchange/StackExchange.Redis/issues/871
871 also lists the above stackexchange question
https://github.com/StackExchange/StackExchange.Redis/issues/743

The client disconnected

I'm getting the following error in logs for WebAPI
System.Web.HttpException (0x800703E3): The client disconnected. at
System.Web.Hosting.IIS7WorkerRequest.EndRead(IAsyncResult asyncResult)
at System.Web.HttpBufferlessInputStream.EndRead(IAsyncResult
asyncResult) at System.Threading.Tasks.TaskFactory
1.FromAsyncTrimPromise 1.Complete(TInstance thisRef, Func 3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at System.IO.StreamReader.d__97.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
System.IO.StreamReader.d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Microsoft.Owin.OwinRequest.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware
1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Web.API.Middleware.OwinMiddleware.d__1.MoveNext()
in D:\UAT\Web.API\Middleware\OwinMiddleware.cs:line 49
How can I handle and ignore these exceptions by exception filter? Why this error occurs and how can I reproduce that? I wanna catch and ignore only The client disconnected but not all HttpException
I saw this similar question but how can I do that in exception filter?
You can ignore these exceptions.
The exception says what the problem is: "The client disconnected". It means that the client initiated a request but then disconnected before it bothered to read all of the response.
There are any numbers of reasons why that might be the case, but (unless you have a dodgy internet connection at your server end) it is almost certainly an issue at the client end. I regularly see these myself and mostly it seems to be related to a bot. So I filter them out and ignore them.
try
{
// Open Connection
// Do stuff
}
catch (HttpException ex)
{
// Log it?
// Ignore it?
// Do what you want with it?
}
finally
{
// Close connection
}

APNS service not sending from hosted computer

I have a push sharp service i need to send notification from hosted computer, i try from normal computer and it send notification but when i run on hosted computer and try to send it gives the exception below:
System.AggregateException: One or more errors occurred. ---> PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> PushSharp.Apple.ApnsConnectionException: Failed to Connect, check your firewall settings! ---> 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 17.188.167.200:2195
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 329
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 374
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<SendBatch>d__7.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 143
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.<Send>d__0.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsServiceConnection.cs:line 49
--- End of inner exception stack trace ---
---> (Inner Exception #0) PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> PushSharp.Apple.ApnsConnectionException: Failed to Connect, check your firewall settings! ---> 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 17.188.167.200:2195
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 329
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 374
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<SendBatch>d__7.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 143
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.<Send>d__0.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsServiceConnection.cs:line 49<---
System.AggregateException: One or more errors occurred. ---> PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> PushSharp.Apple.ApnsConnectionException: Failed to Connect, check your firewall settings! ---> 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 17.188.167.200:2195
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 329
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 374
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<SendBatch>d__7.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 143
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.<Send>d__0.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsServiceConnection.cs:line 49
--- End of inner exception stack trace ---
---> (Inner Exception #0) PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> PushSharp.Apple.ApnsConnectionException: Failed to Connect, check your firewall settings! ---> 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 17.188.167.200:2195
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 329
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsConnection.<connect>d__1c.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 374
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PushSharp.Apple.ApnsConnection.<SendBatch>d__7.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsConnection.cs:line 143
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.<Send>d__0.MoveNext() in c:\D\visualStudioProjects\PushSharp-masterMowazi\PushSharp-master\PushSharp.Apple\ApnsServiceConnection.cs:line 49<---
so i disable the firewall to check but same problem, also i have opened the port below: 2195,2196,443,5223 with ip address range 17.0.0.0 -> 17.255.255.254 but also same problem .. any idea?

Categories

Resources