mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-18 13:34:54 +00:00
Remove old commented (non-async) code from tcp.py
This commit is contained in:
parent
45a32ddd88
commit
b588b55358
@ -101,47 +101,3 @@ class TCP:
|
||||
return None
|
||||
|
||||
return data
|
||||
|
||||
# class TCP(socks.socksocket):
|
||||
# def __init__(self, proxy: dict):
|
||||
# super().__init__()
|
||||
# self.settimeout(10)
|
||||
# self.proxy_enabled = proxy.get("enabled", False)
|
||||
#
|
||||
# if proxy and self.proxy_enabled:
|
||||
# self.set_proxy(
|
||||
# proxy_type=socks.SOCKS5,
|
||||
# addr=proxy.get("hostname", None),
|
||||
# port=proxy.get("port", None),
|
||||
# username=proxy.get("username", None),
|
||||
# password=proxy.get("password", None)
|
||||
# )
|
||||
#
|
||||
# log.info("Using proxy {}:{}".format(
|
||||
# proxy.get("hostname", None),
|
||||
# proxy.get("port", None)
|
||||
# ))
|
||||
#
|
||||
# def close(self):
|
||||
# try:
|
||||
# self.shutdown(socket.SHUT_RDWR)
|
||||
# except OSError:
|
||||
# pass
|
||||
# finally:
|
||||
# super().close()
|
||||
#
|
||||
# def recvall(self, length: int) -> bytes or None:
|
||||
# data = b""
|
||||
#
|
||||
# while len(data) < length:
|
||||
# try:
|
||||
# packet = super().recv(length - len(data))
|
||||
# except OSError:
|
||||
# return None
|
||||
# else:
|
||||
# if packet:
|
||||
# data += packet
|
||||
# else:
|
||||
# return None
|
||||
#
|
||||
# return data
|
||||
|
Loading…
Reference in New Issue
Block a user