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

added enhanced format support using non-blocking socket. #25

Closed
wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2012

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

expiry = datetime.utcnow() + timedelta(30) # undelivered notification expires after 30 seconds

try:
apns.gateway_server.send_notification(token_hex, payload)
Copy link

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?

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..

@dfujiwara
Copy link

Just curious, but what's the status of this pull request?

@djacobs
Copy link
Owner

djacobs commented Sep 10, 2013

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
Copy link

@djacobs What's the status of this and #21 getting merged? @alexbutum just mentioned this issue again in #13 and we're still seeing plenty of these errors pop up as well. It'd be nice to get more visibility into them.

@djacobs
Copy link
Owner

djacobs commented Mar 13, 2014

@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)
Copy link
Collaborator

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/

@ExplodingCabbage
Copy link
Collaborator

I think this was obsoleted by #71 and can be closed?

@djacobs
Copy link
Owner

djacobs commented Jan 26, 2016

I think so, @ExplodingCabbage

@ExplodingCabbage
Copy link
Collaborator

Make it so, then?

@djacobs djacobs closed this Jan 27, 2016
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.

7 participants