-
Notifications
You must be signed in to change notification settings - Fork 374
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
added enhanced format support using non-blocking socket. #25
Conversation
…e occurs while sending notification in old format
expiry = datetime.utcnow() + timedelta(30) # undelivered notification expires after 30 seconds | ||
|
||
try: | ||
apns.gateway_server.send_notification(token_hex, payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the identifier and the expiry variables be used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through a similar pull request here:
#21
I suppose ageron is okay with the fact that we are using non-blocking socket here..
Just curious, but what's the status of this pull request? |
Hey - this actually predates me managing this library and so I missed it. I'll be able to take a look next week. Thanks. |
@thetylerhayes Since these merges introduce conflicts I have to review them before I merge. I will make time for that soon. |
return self._connection().write(string) | ||
|
||
if self.enhanced: # nonblocking socket | ||
rlist, _, _ = select.select([self._connection()], [], [], 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I am trying to get enhanced message with error-response, too.
if select.select here with given timeout = 0s, it often get NO APNS's error-response in time,
when I set to 0.3s it got 90% of error-response, however, it's not guarantee 100% to get error-response for every failed notification, the network connection might also be a factor of delayed time.
Now I am trying to implement using another thread to constantly monitor the read descriptor and response to main thread for further handling. Refering to solution concept: http://redth.info/the-problem-with-apples-push-notification-ser/
I think this was obsoleted by #71 and can be closed? |
I think so, @ExplodingCabbage |
Make it so, then? |
added enhanced format support using non-blocking socket.
since for python 2.5 nonblocking ssl socket is not possible with standard library, enhanced format is only supported for python > 2.5