-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
It seems apns disconnect from Apple's APNs server and establish a new one from the source code:
conn, err := net.Dial("tcp", client.Gateway)
if err != nil {
return err
}
defer conn.Close()
tlsConn := tls.Client(conn, conf)
err = tlsConn.Handshake()
if err != nil {
return err
}
defer tlsConn.Close()
Keep your connections with APNs open across multiple notifications; don’t repeatedly open and close connections. APNs treats rapid connection and disconnection as a denial-of-service attack. You should leave a connection open unless you know it will be idle for an extended period of time—for example, if you only send notifications to your users once a day it is ok to use a new connection each day.
So is it a problem to disconnect and reconnect each time? Is there an option to keep the connection? Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels