| 
					
				 | 
			
			
				@@ -1,7 +1,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import asyncio 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import collections 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import logging 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import signal 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# import signal 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import sys 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,7 +57,6 @@ class Client: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 output_data = file_to_send.read(self.buffer_chunk_size) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 writer.write(output_data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 await writer.drain() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                await asyncio.sleep(1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     async def run_receiving_client(self, file_path='~/input.txt'): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         self._file_path = file_path 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -68,7 +67,6 @@ class Client: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         self._working = True 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         with open(self.file_path, 'wb') as file_to_receive: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             while not self.stopping: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                print("reading...") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 input_data = await reader.read(self.buffer_chunk_size) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if not input_data: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -107,20 +105,20 @@ if __name__ == '__main__': 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         else 'receive' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if len(sys.argv) > 2: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        file_path = sys.argv[2] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _file_path = sys.argv[2] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     else: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        file_path = input(f"Enter file to {action}:\t\t\t\t\t\t") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        _file_path = input(f"Enter file to {action}:\t\t\t\t\t\t") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     loop = asyncio.get_event_loop() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     client = Client( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         host='127.0.0.1', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        port=(5000 if action == 'send' else 5001), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        port=5000, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     # loop.add_signal_handler(signal.SIGINT, client.stop, loop) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     logging.info("Starting client...") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if action.lower() == 'send': 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        loop.run_until_complete(client.run_sending_client(file_path=file_path)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loop.run_until_complete(client.run_sending_client(file_path=_file_path)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     else: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        loop.run_until_complete(client.run_receiving_client(file_path=file_path)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        loop.run_until_complete(client.run_receiving_client(file_path=_file_path)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     loop.close() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     logging.info("Stopped server") 
			 |