8 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
10 print 'Failed to create socket' 17 msg = (
"ON00NO\r",
"ST00TS\r")
22 print 'About to send [' + msg[sel] +
']' 23 sock.sendto(msg[sel], (host, port))
29 (reply, rport) = sock.recvfrom(1024)
30 print 'Got reply : ' + reply
31 print 'On port ' + str(rport)
33 except socket.error, erm:
34 print 'Error Code : ' + str(erm[0]) +
' Message ' + erm[1]