Export to GitHub

apns-python-wrapper - issue #9

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


Posted on Mar 23, 2011 by Quick Rabbit

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

Comment #1

Posted on Jul 14, 2011 by Happy Cat

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

Status: New

Labels:
Type-Defect Priority-Medium