mikekd106 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

getting APNS connection refuse once a while.... #173

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.once a while every other day I get connection refuse exception when we try to 
connect to APNS Server. Code I'm using is in used for more than 1 yr. Same code 
send out more than 10000 + notification everyday.
Jave 1.6  
APNS Jar javapns_2.0_Beta_2.jar

What is the expected output? What do you see instead?

We get following exception once in while out of 10000+ APNS we send to apple. 
Im running Java app on Windows 2003 Server.
Seems to me that Apple is rejecting out connection once a while.

here is Exception:

| 2013/03/13 12:14:40 | java.net.ConnectException: Connection refused: connect
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.net.PlainSocketImpl.socketConnect(Native Method)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.net.PlainSocketImpl.doConnect(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.net.PlainSocketImpl.connectToAddress(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.net.PlainSocketImpl.connect(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.net.SocksSocketImpl.connect(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at java.net.Socket.connect(Unknown 
Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
javapns.communication.ConnectionToAppleServer.getSSLSocket(ConnectionToAppleServ
er.java:124)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
javapns.notification.PushNotificationManager.initializeConnection(PushNotificati
onManager.java:87)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
javapns.Push.payload(Push.java:113)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.pbc.ensagent.apns.ApnsSender.sendApns(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.pbc.ensagent.apns.ApnsSender.transmitEvent(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
com.pbc.ensagent.apns.ApnsFacade$2.run(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.util.concurrent.FutureTask.run(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO   | jvm 1    | 2013/03/13 12:14:40 |   at java.lang.Thread.run(Unknown 
Source)

What version of the product are you using? On what operating system?
Version i'm using is 2.0B

Please provide any additional information below.

Original issue reported on code.google.com by danburyh...@gmail.com on 15 Mar 2013 at 2:34

GoogleCodeExporter commented 8 years ago
Is this connection exception causing some payloads not to be delivered, or does 
the library recover and retry with a new connection?

Original comment by sype...@gmail.com on 8 May 2013 at 9:22

GoogleCodeExporter commented 8 years ago
I'm facing same issue. I get this exception when a thread is initiating a 
connection to apple. I was running 400 threads simaltaniosly and this issue 
happens intemitently. 
It cannot be coz of firewall.

Original comment by mohamfbh...@gmail.com on 10 May 2013 at 2:34

GoogleCodeExporter commented 8 years ago
Same question:  is this connection exception causing some payloads not to be 
delivered, or does the library recover and retry with a new connection?

Original comment by sype...@gmail.com on 10 May 2013 at 2:59

GoogleCodeExporter commented 8 years ago
We're having same issue when sending to more than a few thousand devices - our 
last push was supposed to go to 5919 devices but only about 4000 went and then 
we got the connection timeout from APNS as seen in the errors file attached. 

Look forward to a solution to this.  Read somewhere about using persistent 
connection to APNS - if there an option to enable persistent connection? 

Thanks,
Dishant

Original comment by dishant....@gmail.com on 4 Jun 2013 at 8:54

Attachments: