async Task SendErrorResponse(Socket s, ApnsNotificationErrorStatusCode statusCode, int identifier) { Failed++; Successful--; var errorResponseData = new byte[6]; errorResponseData[0] = 0x01; errorResponseData[1] = BitConverter.GetBytes((short)statusCode)[0]; var id = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(identifier)); Buffer.BlockCopy(id, 0, errorResponseData, 2, 4); var sent = await s.SendAsync(new ArraySegment<byte>(errorResponseData, 0, errorResponseData.Length), SocketFlags.None); }
void SendErrorResponse(Socket s, ApnsNotificationErrorStatusCode statusCode, int identifier) { Failed++; Successful--; var errorResponseData = new byte[6]; errorResponseData[0] = 0x01; errorResponseData[1] = BitConverter.GetBytes((short)statusCode)[0]; var id = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(identifier)); Buffer.BlockCopy(id, 0, errorResponseData, 2, 4); var sent = Task.Factory.FromAsync <int> ( s.BeginSend(errorResponseData, 0, errorResponseData.Length, SocketFlags.None, null, null), s.EndSend).Result; }
void SendErrorResponse(Socket s, ApnsNotificationErrorStatusCode statusCode, int identifier) { Failed++; Successful--; var errorResponseData = new byte[6]; errorResponseData[0] = 0x01; errorResponseData[1] = BitConverter.GetBytes((short)statusCode)[0]; var id = BitConverter.GetBytes(IPAddress.HostToNetworkOrder(identifier)); Buffer.BlockCopy(id, 0, errorResponseData, 2, 4); throw new NotImplementedException("replace .BeginSend() and .EndSend() in dotnetcore somehow?!"); //var sent = Task.Factory.FromAsync<int> ( // s.BeginSend (errorResponseData, 0, errorResponseData.Length, SocketFlags.None, null, null), // s.EndSend).Result; }
public ApnsResponseFilter(ApnsNotificationErrorStatusCode status, IsMatchDelegate isMatchHandler) { IsMatch = isMatchHandler; Status = status; }
public ApnsNotificationException(ApnsNotificationErrorStatusCode statusCode, string msg) : base(msg) { ErrorStatusCode = statusCode; }
public ApnsNotificationException(ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification, Exception innerException) : base("Apns notification error: '" + errorStatusCode + "'", notification, innerException) { Notification = notification; ErrorStatusCode = errorStatusCode; }
public ApnsNotificationException (ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification, Exception innerException) : base ("Apns notification error: '" + errorStatusCode + "'", notification, innerException) { Notification = notification; ErrorStatusCode = errorStatusCode; }
public ApnsResponseFilter (ApnsNotificationErrorStatusCode status, IsMatchDelegate isMatchHandler) { IsMatch = isMatchHandler; Status = status; }
public ApnsNotificationException (ApnsNotificationErrorStatusCode statusCode, string msg) : base (msg) { ErrorStatusCode = statusCode; }
void SendErrorResponse (Socket s, ApnsNotificationErrorStatusCode statusCode, int identifier) { Failed++; Successful--; var errorResponseData = new byte[6]; errorResponseData[0] = 0x01; errorResponseData[1] = BitConverter.GetBytes ( (short)statusCode)[0]; var id = BitConverter.GetBytes (IPAddress.HostToNetworkOrder (identifier)); Buffer.BlockCopy (id, 0, errorResponseData, 2, 4); var sent = Task.Factory.FromAsync<int> ( s.BeginSend (errorResponseData, 0, errorResponseData.Length, SocketFlags.None, null, null), s.EndSend).Result; }
public ApnsNotificationException(ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification) : base($"Apns notification error: '{errorStatusCode}'") { Notification = notification; ErrorStatusCode = errorStatusCode; }