sender.py 294 Bytes
Newer Older
1 2 3 4 5
import sys
import prrt

host = sys.argv[1]
port = int(sys.argv[2])
6
localport = int(sys.argv[3])
7

rna's avatar
rna committed
8
s = prrt.PrrtSocket(("127.0.1.1", localport), maximum_payload_size=150)
Andreas Schmidt's avatar
Andreas Schmidt committed
9
s.connect((host, port))
10 11

for i in range(10):
12 13
    s.send("Packet {}".format(i).encode("utf8"))
s.send("Close".encode("utf8"))