mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 04:30:22 +03:00
infinite loop while proxy server refuse connection fix
This commit is contained in:
parent
4050d1ca00
commit
9e08d5b735
|
@ -4,6 +4,7 @@ This module holds a rough implementation of the C# TCP client.
|
|||
import errno
|
||||
import socket
|
||||
import time
|
||||
from socks import ProxyConnectionError
|
||||
from datetime import timedelta
|
||||
from io import BytesIO, BufferedWriter
|
||||
from threading import Lock
|
||||
|
@ -69,6 +70,8 @@ class TcpClient:
|
|||
|
||||
self._socket.connect(address)
|
||||
break # Successful connection, stop retrying to connect
|
||||
except ProxyConnectionError:
|
||||
raise
|
||||
except OSError as e:
|
||||
# There are some errors that we know how to handle, and
|
||||
# the loop will allow us to retry
|
||||
|
|
Loading…
Reference in New Issue
Block a user