timehop / apns

A Go package to interface with the Apple Push Notification Service
https://godoc.org/github.com/timehop/apns
MIT License
185 stars 47 forks source link

Reconnect after certain idle time, avoid pseudorandomly choose a ready channel. #62

Closed kevwan closed 2 years ago

kevwan commented 8 years ago
  1. reconnect after certain idle time. we found after long time idle, some of our pushes are dropped. And the network situation in countries like China are complex. Some routers disconnect the connections after certain idle time. So 5 minutes is a safe time.
  2. avoid pseudorandomly choose a ready channel. this is trivial, but as you commented it. I just add some code to avoid the pseudorandomly choose. But it doesn't work for the scenario, when we got a notification, an error occurred before we finish sending. At lease it step further. If you think it's worthy, merge it, or ignore it.

Thanks, Kevin

nathany commented 8 years ago

Kevin, I'm wondering if adding the Keep Alive option #63 would work just as well as reconnecting after idle time?

kevwan commented 8 years ago

Nathany, I think it should work. But the Keep Alive option is system dependent. As a library, I would like to control it in the code.

Thanks for your reply!

nathany commented 8 years ago

@bdotdub What do you think?