mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 20:50: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 errno
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
from socks import ProxyConnectionError
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from io import BytesIO, BufferedWriter
|
from io import BytesIO, BufferedWriter
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
@ -69,6 +70,8 @@ class TcpClient:
|
||||||
|
|
||||||
self._socket.connect(address)
|
self._socket.connect(address)
|
||||||
break # Successful connection, stop retrying to connect
|
break # Successful connection, stop retrying to connect
|
||||||
|
except ProxyConnectionError:
|
||||||
|
raise
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
# There are some errors that we know how to handle, and
|
# There are some errors that we know how to handle, and
|
||||||
# the loop will allow us to retry
|
# the loop will allow us to retry
|
||||||
|
|
Loading…
Reference in New Issue
Block a user