# Source: https://pymotw.com/2/socket/udp.html

import socket, sys, time, json

host = sys.argv[1]
textport = sys.argv[2]
n = 10

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = int(textport)
server_address = (host, port)
i = 0

while i < 10:
    i += 1
    data = {"name": "john", "age": 30 + i, "city": "new York"}
    datay = json.dumps(data);
    
#    s.sendall(data.encode('utf-8'))
    s.sendto(datay.encode('utf-8'), server_address)

s.shutdown(1)


ea349c52a342b0574e27bfa269403d8984c033bd
<mask token>

<mask token>
while i < 10:
    i += 1
    data = {'name': 'john', 'age': 30 + i, 'city': 'new York'}
    datay = json.dumps(data)
    s.sendto(datay.encode('utf-8'), server_address)
s.shutdown(1)

<mask token>
host = sys.argv[1]
textport = sys.argv[2]
n = 10
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = int(textport)
server_address = host, port
i = 0
while i < 10:
    i += 1
    data = {'name': 'john', 'age': 30 + i, 'city': 'new York'}
    datay = json.dumps(data)
    s.sendto(datay.encode('utf-8'), server_address)
s.shutdown(1)

import socket, sys, time, json
host = sys.argv[1]
textport = sys.argv[2]
n = 10
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = int(textport)
server_address = host, port
i = 0
while i < 10:
    i += 1
    data = {'name': 'john', 'age': 30 + i, 'city': 'new York'}
    datay = json.dumps(data)
    s.sendto(datay.encode('utf-8'), server_address)
s.shutdown(1)

# Source: https://pymotw.com/2/socket/udp.html

import socket, sys, time, json

host = sys.argv[1]
textport = sys.argv[2]
n = 10

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = int(textport)
server_address = (host, port)
i = 0

while i < 10:
    i += 1
    data = {"name": "john", "age": 30 + i, "city": "new York"}
    datay = json.dumps(data);
    
#    s.sendall(data.encode('utf-8'))
    s.sendto(datay.encode('utf-8'), server_address)

s.shutdown(1)

