Menu

#360 Getting Connection Resets from apns server

open
nobody
None
2020-08-11
2018-09-15
Anonymous
No

Originally created by: sidaxe

My application needs to push notifications to ios devices. I used Notoop java-apns 0.2.2 as java client for pushing notification.

I frequently get these errors in my log logged by monitorSocket thread.

```
2018-09-07 15:41:57.379 c.n.a.i.ApnsConnectionImpl [INFO] Exception while waiting for error code
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:1.8.0_131]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_131]
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:1.8.0_131]
at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_131]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[?:1.8.0_131]
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930) ~[?:1.8.0_131]
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) ~[?:1.8.0_131]
at java.io.InputStream.read(InputStream.java:101) ~[?:1.8.0_131]
at com.notnoop.apns.internal.ApnsConnectionImpl$1MonitoringThread.run(ApnsConnectionImpl.java:114) [apns-0.2.2.jar:?]

I understand, This error is generated by MonitoringThread which listens on socket input stream for errors.( Apple only provides a response for error messages and then it closes the connection).
In my case , the connection gets reset before any response code is received and due to this , the client creates a new socket connection with apns server, but the sent message is lost.

What could be the possible reasons that apns server is resetting connection without sending any error codes?  Many of my messages are getting lost this way.

Discussion

  • Anonymous

    Anonymous - 2019-11-28

    Originally posted by: putuyuwono

    Any updates on this issue? Would you share any solution to this?

     
  • Anonymous

    Anonymous - 2020-08-11

    Originally posted by: petarov

    @airobot60 It seems your APNS certificate is either expired or there's something wrong with how it's been generated.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.