Comments (4)
@cissoid Odd. Once the Client
is removed from the ClientManager
, the reference to it should be lost and Go should GC it and close the connections automatically, shouldn't it? Is there anything in the code that doesn't exhibit that behavior?
Each client has its own Transport
, which means calling CloseIdleConnections()
on it won't affect other clients. I would be concerned when a client is "checked out" from the ClientManager
and being used. CloseIdleConnections()
wouldn't affect it, but it also wouldn't clean up after itself properly when the client is removed.
from apns2.
Once the Client is removed from the ClientManager, the reference to it should be lost and Go should GC it and close the connections automatically
I took a look at go source code. After connection created, there will start a new goroutine to run read loop, so there's should have another reference point to the connection, see https://github.com/golang/net/blob/master/http2/transport.go#L573.
The read loop will close connection only if keepalive on current connection is disabled, and exit loop only when read error, see https://github.com/golang/net/blob/master/http2/transport.go#L1458.
I'm not sure but this might be the reason.
from apns2.
@cissoid That behavior makes sense, I suppose. We could set DisableKeepAlives
to true on the transport after a client is removed.
from apns2.
@dwieeb That not works, DisableKeepAlives
only checked when read loop starting, change it after connection created seems no effect.
from apns2.
Related Issues (20)
- How to specify the connection environment when using ClientManager
- ask a question for usage HOT 1
- Support for apns-push-type in header HOT 2
- silent push not working in iOS13 when run through xcode
- ios push notification multiple devices HOT 2
- Error causing frequent crashes HOT 4
- x509: certificate signed by unknown authority HOT 3
- write:broken pipe
- x509: certificate signed by unknown authority HOT 13
- About GeoTrust Global CA root certificate(removal) upgrade HOT 1
- Please drop Hyper and consider using http HOT 2
- Replace github.com/dgrijalva/jwt-go with github.com/golang-jwt/jwt HOT 2
- APNs urls should be in a config file HOT 1
- Replace github.com/dgrijalva/jwt-go
- What are the pros and cons of using a p12 certificate vs JWT? HOT 2
- Issue release with latest changes HOT 1
- Perf to be faster HOT 1
- Does apns support broadcast mode push ? HOT 1
- Missing Error Reason: Expired Token
- ios Live activity HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apns2.