parent
							
								
									925742768d
								
							
						
					
					
						commit
						bd1c44488d
					
				
					 1 changed files with 8 additions and 8 deletions
				
			
		|  | @ -8,7 +8,7 @@ import socket | ||||||
| 
 | 
 | ||||||
| def discover(timeout=None): | def discover(timeout=None): | ||||||
|   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||||||
|   s.connect(('8.8.8.8', 0))  # connecting to a UDP address doesn't send packets |   s.connect(('8.8.8.8', 53))  # connecting to a UDP address doesn't send packets | ||||||
|   local_ip_address = s.getsockname()[0] |   local_ip_address = s.getsockname()[0] | ||||||
|   address = local_ip_address.split('.') |   address = local_ip_address.split('.') | ||||||
|   cs = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |   cs = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue