code: private int processedFailedNotifications() throws CommunicationException, KeystoreException {
  		if (useEnhancedNotificationFormat) {
  			logger.debug("Reading responses");
  			int responsesReceived = ResponsePacketReader.processResponses(this);
  			while (responsesReceived > 0) {
  				PushedNotification skippedNotification = null;
  				List<PushedNotification> notificationsToResend = new ArrayList<PushedNotification>();
  				boolean foundFirstFail = false;
  				for (PushedNotification notification : pushedNotifications.values()) {
  					if (foundFirstFail || !notification.isSuccessful()) {
  						if (foundFirstFail) notificationsToResend.add(notification);
  						else {
  							foundFirstFail = true;
  							skippedNotification = notification;
  						}
  					}
  				}
  				pushedNotifications.clear();
  				int toResend = notificationsToResend.size();
  				logger.debug("Found " + toResend + " notifications that must be re-sent");
  				if (toResend > 0) {
  					logger.debug("Restarting connection to resend notifications");
  					restartPreviousConnection();
  					for (PushedNotification pushedNotification : notificationsToResend) {
  						sendNotification(pushedNotification, false);
  					}
  				}
  				int remaining = responsesReceived = ResponsePacketReader.processResponses(this);
  				if (remaining == 0) {
  					logger.debug("No notifications remaining to be resent");
  					return 0;
  				}
  			}
  			return responsesReceived;
  		} else {
  			logger.debug("Not reading responses because using simple notification format");
  			return 0;
  		}
  	}
docs: Read and process any pending error-responses.
  
  If an error-response packet is received for a particular message, this
  method assumes that messages following the one identified in the packet
  were completely ignored by Apple, and as such automatically retries to
  send all messages after the problematic one.
  
  @return the number of error-response packets received
  @throws CommunicationException thrown if a communication error occurs
  @throws KeystoreException thrown if there is a problem with your keystore