benratti / javapns

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

Unable to connect APNS - CommunicationException - java.net.ConnectionException : Communication Timed Out #232

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Invoking jar that send 20,000 APNS's notifications repeatedly (avg. every 1 
minute)

What is the expected output? What do you see instead?
Expected output : all notification pushed.
Actual output : CommunicationException thrown along the way.

What version of the product are you using? On what operating system?
- javapns2.2
- ubuntu

Please provide any additional information below.
Stack Trace :::
javapns.communication.exceptions.CommunicationException: Communication 
exception: java.net.ConnectException: Connection timed out
    at javapns.communication.ConnectionToAppleServer.getSSLSocket(ConnectionToAppleServer.java:158)
    at javapns.notification.PushNotificationManager.initializeConnection(PushNotificationManager.java:106)
    at javapns.notification.transmission.NotificationThread.runList(NotificationThread.java:215)
    at javapns.notification.transmission.NotificationThread.run(NotificationThread.java:199)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
    at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:415)
    at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
    at javapns.communication.ConnectionToAppleServer.getSSLSocket(ConnectionToAppleServer.java:155)
    ... 4 more

Certain Part of Code :::
List<PushedNotification> pushedNotificationList = Push.payload(pl, p12FilePath, 
p12Password, gateway, 20, iosTokens);

The code is execute on 10 threads each one execute this code, so totally 200 of 
threads invoked per minute.

Additional Note :
The javapns documents does not show any examples of how to handling error for 
CommunicationException, java.net.ConnectionException : Connection Timed out
The apple docs does not state limit on concurrent connection.

If we send bulk of notifications through [Push.payload(pl, p12FilePath, 
p12Password, gateway, 20, iosTokens);] and it failed (with this error) along 
the way, 
Should we retry it all? 
Will some of the notification pushed by invoking this [Push.payload()] goes 
through APNS and to user's devices or all of them are dropped?

Original issue reported on code.google.com by Myste1ta...@gmail.com on 19 Feb 2015 at 9:56

GoogleCodeExporter commented 9 years ago
Another Additional Note :
It could be internet connection problem like firewall but I'm skeptical because
we also have Android Notifications, sending android notifications never has 
Connection Timed Out, while sending APNS does.

Original comment by Myste1ta...@gmail.com on 19 Feb 2015 at 10:08

GoogleCodeExporter commented 9 years ago
I have the same problem.
the exception: javapns.communication.exceptions.CommunicationException: 
Communication exception: java.net.ConnectException: Connection timed out

do you solve the ? 

Original comment by Stormcor...@gmail.com on 19 Mar 2015 at 7:39