mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	 9c6bd77e39
			
		
	
	
		9c6bd77e39
		
	
	
	
	
		
			
			svn+ssh://pythondev@svn.python.org/python/trunk ........ r78779 | benjamin.peterson | 2010-03-07 20:11:06 -0600 (Sun, 07 Mar 2010) | 1 line remove svn:executable from scripts without a shebang line ........
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			283 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			283 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # Send UDP broadcast packets
 | |
| 
 | |
| MYPORT = 50000
 | |
| 
 | |
| import sys, time
 | |
| from socket import *
 | |
| 
 | |
| s = socket(AF_INET, SOCK_DGRAM)
 | |
| s.bind(('', 0))
 | |
| s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
 | |
| 
 | |
| while 1:
 | |
|     data = repr(time.time()) + '\n'
 | |
|     s.sendto(data, ('<broadcast>', MYPORT))
 | |
|     time.sleep(2)
 |