mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-26 13:41:01 +03:00 
			
		
		
		
	Remove socket fd from the loop reader upon closing
This commit is contained in:
		
							parent
							
								
									aaa7ec757b
								
							
						
					
					
						commit
						145d4b7105
					
				|  | @ -107,6 +107,7 @@ class TcpClient: | |||
| 
 | ||||
|     def close(self): | ||||
|         """Closes the connection.""" | ||||
|         fd = self._socket.fileno() | ||||
|         try: | ||||
|             if self._socket is not None: | ||||
|                 if self.is_connected: | ||||
|  | @ -117,6 +118,8 @@ class TcpClient: | |||
|         finally: | ||||
|             self._socket = None | ||||
|             self._closed.set() | ||||
|             if fd: | ||||
|                 self._loop.remove_reader(fd) | ||||
| 
 | ||||
|     async def _wait_timeout_or_close(self, coro): | ||||
|         """ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user