Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enhanced message and its corresponding error-handling, resent mechanism Fix #61. #71

Merged
merged 4 commits into from
Jun 23, 2014

Conversation

jimhorng
Copy link
Collaborator

@jimhorng jimhorng commented Jun 4, 2014

Add enhanced message and its corresponding error-handling, resent mechanism Fix #61.
Problem Addressed (Reference to Redth):

  • Async response of error response and response time varies from 0.1 ~ 0.8 secs by observation
  • Sent success do not response, which means client cannot always expect for response.
  • Async close write stream connection after error-response.
  • All notification sent after failed notification are discarded, the responding error-response and closing client's write connection will be delayed
  • Sometimes APNS close socket connection arbitrary

Solution:

  • Non-blocking ssl socket connection to send notification without waiting for response.
  • A separate thread for constantly checking error-response from read connection.
  • A sent notification buffer used for re-sending notification that were sent after failed notification, or arbitrary connection close by apns.
  • Reference to non-blocking apns pull request by minorblend, enhanced message by hagino3000

Result:

  • Send notification at throughput of 1000/secs
  • In worse case of when 1st notification sent failed, error-response respond after 1 secs and 999 notification sent are discarded by APNS at the mean time, all discarded 999 notifications will be resent without loosing any of them. With the same logic, if notification resent failed, it will resent rest of resent notification after the failed one.

Test:
Sample code to test above function

@djacobs
Copy link
Owner

djacobs commented Jun 4, 2014

Thanks - this is significant! I'll review shortly.

@jimhorng
Copy link
Collaborator Author

jimhorng commented Jun 5, 2014

Hi djacobs, I had updated comment to include test script to test the new functionalities.

@djacobs
Copy link
Owner

djacobs commented Jun 23, 2014

@jimhorng OK - I am catching up in the wrong order, obviously. Thank you for this and for your patience.

djacobs added a commit that referenced this pull request Jun 23, 2014
Add enhanced message and its corresponding error-handling, resent mechanism Fix #61.
@djacobs djacobs merged commit 24a6edf into djacobs:master Jun 23, 2014
@jimhorng
Copy link
Collaborator Author

Thanks for reviewing this PR, hope this helps :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

APNS to support error-response handling(enhanced message) and re-send mechanism for performance
2 participants