client.py
13 lines
| 354 B
| text/x-python
|
PythonLexer
r56 | import socket | |||
r58 | import select | |||
r56 | ||||
dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) | ||||
r58 | #dgramSock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |||
#dgramSock.setblocking(0) | ||||
dgramSock.sendto( "Hello World\n", ('192.168.1.117', 7000) ) | ||||
ready = select.select ([dgramSock],[],[],35) | ||||
if ready[0]: | ||||
print dgramSock.recv( 100 ) | ||||
r56 | dgramSock.close() | |||