pushy icon indicating copy to clipboard operation
pushy copied to clipboard

How to close idle connection

Open cyflhn opened this issue 5 years ago • 4 comments

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?

cyflhn avatar Jun 19 '20 03:06 cyflhn

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?

jchambers avatar Jun 19 '20 12:06 jchambers

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.

cyflhn avatar Jun 20 '20 09:06 cyflhn

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

jchambers avatar Jul 18 '20 14:07 jchambers

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

jchambers avatar Jan 15 '24 21:01 jchambers