Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apns2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ def connect(self) -> None:
while retries < MAX_CONNECTION_RETRIES:
# noinspection PyBroadException
try:
if retries > 0:
# HTTP20Connection._sock might get stuck, this line closes the HTTP20Connection manually to reset it
# fully from the second retry onwards
self._connection.close()

self._connection.connect()
logger.info('Connected to APNs')
return
Expand Down