我使用PushSharp 4.0.10发送iOS推送通知但我最近注意到托管代理的控制台应用程序将通知排队到大约18,000个设备令牌后发送一些通知收到此错误消息后崩溃:
[错误] APNS-CLIENT [1]:发送批错误:批次ID = 4,错误 或= System.IO.IOException:无法将数据写入传输 连接:远程强制关闭紧急连接 主办。 ---> System.Net.Socke ts.SocketException:现有连接 被远程办公室强行关闭了 System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
---内部异常堆栈跟踪的结束---在System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult)上 在System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult)
在 System.IO.Stream<> c__DisplayClass0.b__17(流 strea m,IAsyncResult asyncResult)at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise
1.Complete(TInst ance thisRef,Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchr onization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot ification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
1.FromAsyncTrim [TInstance,TArgs](TInsta) nce thisRef,TArgs args,Func
at PushSharp.Apple.ApnsConnection.<SendBatch>d__21.MoveNext() 2016-04-07 12:09:52.PM [ERROR] APNS-Client[1]: Reader Exception: System.IO.IOExc eption: Unable to read data from the transport connection: An established connec tion was aborted by the software in your host machine. ---> System.Net.Sockets.S ocketException: An established connection was aborted by the software in your ho st machine at System.Net.Sockets.Socket.BeginReceive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state) at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, In t32 size, AsyncCallback callback, Object state) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32 offset, In t32 size, AsyncCallback callback, Object state) at System.Net.FixedSizeReader.StartReading() at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offse t, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, I nt32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, In t32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.BeginRead(Byte[] buffer, Int32 offset, Int3 2 count, AsyncCallback asyncCallback, Object asyncState) at System.Net.Security.SslStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback asyncCallback, Object asyncState) at System.IO.Stream.<>c__DisplayClass0.<BeginEndReadAsync>b__7(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state) at System.Threading.Tasks.TaskFactory5 beginMethod, Func
3 endMethod)at System.IO.Stream.BeginEndReadAsync(Byte []缓冲区,Int32偏移量,Int32 在System.IO.Stream.ReadAsync(Byte []缓冲区,Int32偏移量, Int32计数,取消llationToken cancellationToken) System.IO.Stream.ReadAsync(Byte []缓冲区,Int32偏移量,Int32计数)
在PushSharp.Apple.ApnsConnection.d__23.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务 任务) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot 通知(任务任务)at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(任务任务)
在PushSharp.Apple.ApnsConnection.d__21.MoveNext() 2016-04-07 12:09:59.PM [ERROR] APNS-CLIENT [1]:发送批处理错误:批处理 ID = 6,Err或= System.NullReferenceException:未设置对象引用 到一个对象的实例。在 PushSharp.Apple.ApnsConnection.createBatch(List`1 toSend)at PushSharp.Apple.ApnsConnection.d__21.MoveNext()未处理的异常:System.NullReferenceException:对象引用 未设置为对象的实例。在 PushSharp.Apple.ApnsConnection.d__21.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务 任务) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot 通知(任务任务)at PushSharp.Apple.ApnsConnection&LT;。&LT; -ctor&GT; b__1_0&GT; d.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.CompilerServices.AsyncMethodBuilderCore&LT;&GT; c__DisplayClass2。 b__5(对象状态)at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(对象 sta te)at System.Threading.ExecutionContext.RunInternal(执行上下文 executionCo ntext,ContextCallback回调,对象状态,布尔值 preserveSyncCtx)at System.Threading.ExecutionContext.Run(执行上下文 executionContext,C ontextCallback回调,对象状态,布尔值 preserveSyncCtx)at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWor kItem.ExecuteWorkItem()at System.Threading.ThreadPoolWorkQueue.Dispatch()at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
知道为什么会这样吗?这与并发连接有关吗?如果是,PushSharp本身不会自行处理吗?