File tree Expand file tree Collapse file tree
pyrogram/connection/transport/tcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import logging
2020from binascii import crc32
2121from struct import pack , unpack
22- from typing import Optional
22+ from typing import Optional , Tuple
2323
24- from .tcp import TCP
24+ from .tcp import TCP , Proxy
2525
2626log = logging .getLogger (__name__ )
2727
2828
2929class TCPFull (TCP ):
30- def __init__ (self , ipv6 : bool , proxy : dict ) :
30+ def __init__ (self , ipv6 : bool , proxy : Proxy ) -> None :
3131 super ().__init__ (ipv6 , proxy )
3232
33- self .seq_no = None
33+ self .seq_no : Optional [ int ] = None
3434
35- async def connect (self , address : tuple ) :
35+ async def connect (self , address : Tuple [ str , int ]) -> None :
3636 await super ().connect (address )
3737 self .seq_no = 0
3838
39- async def send (self , data : bytes , * args ):
39+ async def send (self , data : bytes , * args ) -> None :
4040 data = pack ("<II" , len (data ) + 12 , self .seq_no ) + data
4141 data += pack ("<I" , crc32 (data ))
4242 self .seq_no += 1
You can’t perform that action at this time.
0 commit comments