udp.py 268 Bytes
Newer Older
1 2 3
import socket

UDP_IP = "127.0.0.1"
4 5
UDP_PORT = 9223
MESSAGE = "123,1,START"
6
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
7 8 9 10 11
sd.sendto(MESSAGE, (UDP_IP, UDP_PORT))
#sd.bind((UDP_IP, UDP_PORT))
#while True:
#	data, addr = sd.recvfrom(1024)
#	print("recv: ", data)