hi-yox / apns-python-wrapper

Automatically exported from code.google.com/p/apns-python-wrapper
0 stars 0 forks source link

socket.error: [Errno 54] Connection reset by peer #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
when input  
$python apnstest.py

Traceback (most recent call last):
  File "apnstest.py", line 18, in <module>
    wrapper.notify()
  File "build/bdist.macosx-10.6-universal/egg/APNSWrapper/notifications.py", line 195, in notify
  File "build/bdist.macosx-10.6-universal/egg/APNSWrapper/connection.py", line 215, in connect
  File "build/bdist.macosx-10.6-universal/egg/APNSWrapper/connection.py", line 161, in connect
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py", line 309, in connect
    self.do_handshake()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py", line 293, in do_handshake
    self._sslobj.do_handshake()
socket.error: [Errno 54] Connection reset by peer

My python file apnstest.py info:
deviceToken = '.........................................'
from APNSWrapper import APNSNotificationWrapper,APNSNotification

# create wrapper
wrapper = APNSNotificationWrapper('/Users/hanmj/Desktop/cert.pem', True)

# create message
message = APNSNotification()
message.token(deviceToken)
message.badge(5)
#message.alert("dddd")

# add message to tuple and send it to APNS server
wrapper.append(message)
print("send")
wrapper.notify()

thank you!

hanmingjie@gmail.com

Original issue reported on code.google.com by hanming...@gmail.com on 23 Mar 2011 at 8:32

GoogleCodeExporter commented 8 years ago
There's several possible reasons when interruption caused:

 - when you have issue with your certeficate
 - when APNS service host is not reachable
 - in case when APNS service banned your API for some reason

Original comment by klymys...@gmail.com on 14 Jul 2011 at 9:28