Giter Club home page Giter Club logo

Comments (6)

RamosLi avatar RamosLi commented on July 28, 2024

对,每一个证书对应一个ApnsServiceImpl实例,注意还需要调用下apnsConfig.setName(),给每个设置成不同的名称就OK了

from dbay-apns-for-java.

lizhitao0923 avatar lizhitao0923 commented on July 28, 2024

回复的真快,给力!不设置apnsConfig.setName()名称会出现怎样的问题?

from dbay-apns-for-java.

lizhitao0923 avatar lizhitao0923 commented on July 28, 2024

如果我将ApnsServiceImpl的实例放到一个Map当中,长时间不用后取出来还能连上apns服务器吗,会不会自动断掉?

from dbay-apns-for-java.

RamosLi avatar RamosLi commented on July 28, 2024

嗯,你完全可以把ApnsService的实例放到map里管理。TCP连接断掉后会重新连接,所以能确保发送成功

from dbay-apns-for-java.

lizhitao0923 avatar lizhitao0923 commented on July 28, 2024

谢谢~!我还请教一个问题,官网说“应该保持一份连接多个通知的APNs的链接。APNs会把多次并重复尝试建立的连接是为DOS攻击服务而拒绝建立链接”,这个指的是不多次SSLContext context = SSLContext.getInstance(protocol);初始化吗?因为我看你的程序当中每次发送消息的socket都关闭了。

from dbay-apns-for-java.

RamosLi avatar RamosLi commented on July 28, 2024

你再仔细看看吧,一条连接建立后会重复使用,直到出错或者IDLE超过一定时间才会重新建立。你是不是每发送一条,就调用了shutdown啊? shutdown是在Java进程退出时调用,或者不调也可以。

from dbay-apns-for-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.