sender.py 292 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

Andreas Schmidt's avatar
Andreas Schmidt committed
8
s = prrt.PrrtSocket(("0.0.0.0", localport), maximum_payload_size=150)
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"))