pushy
pushy copied to clipboard
How to close idle connection
There is a option to configure maximum connections for a apns client, but it seems that there is no option to configure how to close a connection which is idle for long time. Is there any method to meet this requirement?
There isn't currently a way to close idle connections. We can call this a feature request. Can you explain your use case a little more? How many connections do you have, and why is it important to close the idle ones?
We need to send notifications to many apps. If we have 10 apps, we need to create 10 apns clients. As the number of apps increase, the number of concurrent connections also increase. We have limit number of concurrent open connections on our server, so we need to close those connections which are not used for long time as soon as possible.
Pardon the delay. I'll think about this as we move toward multiple credential sets per client, but I don't plan to add this as an independent feature in the near term (i.e. not in the 0.14 series).
I've proposed a change in #1048 that will simply close connections when they're idle (instead of sending PING frames to keep them open).