Commit 1fcd1216 authored by Alan Marchiori's avatar Alan Marchiori

added simple client

parent a8bd9f45
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 8888
MESSAGE = b"Hello, World!\n"
print ("UDP target IP:", UDP_IP)
print ("UDP target port:", UDP_PORT)
print ("message:", MESSAGE)
with socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) as sock: # UDP
#sock.bind((UDP_IP, 8889))
print("Socket:", sock)
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
#print("Socket:", sock)
#sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
#print("Socket:", sock)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment