s is a standard tcp socket,this is the server:
s = socket.socket()
s.connect(("127.0.0.1", 5203))
with open("example.txt" "wb+") as f:
exqwrt = f.read(1024)
while (exqwrt):
s.send(exqwrt)
exqwrt = f.read(1024)
code on client is, s is a standard tcp socket as well:
s = socket.socket()
s.bind(("127.0.0.1", 5203))
s.listen(5)
conn, addr = s.accept()
openedFile = open("examplet.txt", "wb+")
while True:
exwqrt = conn.recv(1024)
openedFile.write(exqwrt)
if not exqwrt:
break
The problem is that file gets sent pretty fast.But it is written on examplet.txt pretty slowly in like 5 minutes.