aboutsummaryrefslogtreecommitdiff
path: root/netsec-assignment1-S4498062/exercise1/netcat.py
blob: 1bd7fd9c8feed9308db05c24cd2ce257fc90b346 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python3

import socket

s = socket.create_connection(("localhost", 42424))
stringbuf = ""
for i in range(0, 1000):
    stringbuf = stringbuf + "spam " + str(i) + "\n"
buf = stringbuf.encode("utf-8")
s.sendall(buf)
s.close()