Exemplo n.º 1
0
 public ApnsNotificationException (ApnsNotificationErrorStatusCode errorStatusCode, ApnsNotification notification, Exception innerException)
     : base ("Apns notification error: '" + errorStatusCode + "'", notification, innerException)
 {
     Notification = notification;
     ErrorStatusCode = errorStatusCode;
 }
Exemplo n.º 2
0
 public ApnsNotificationException (ApnsNotificationErrorStatusCode statusCode, string msg) : base (msg)
 {
     ErrorStatusCode = statusCode;
 }
Exemplo n.º 3
0
 public ApnsResponseFilter (ApnsNotificationErrorStatusCode status, IsMatchDelegate isMatchHandler)
 {
     IsMatch = isMatchHandler;
     Status = status;
 }
Exemplo n.º 4
0
        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;
        }