From dc671986a34637b7c6fc917073a3c19c03a1a547 Mon Sep 17 00:00:00 2001 From: kris Date: Sat, 23 Feb 2019 23:28:33 +0000 Subject: [PATCH] Send contents of out.bin file --- server.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index 53aba03..fdebc1b 100644 --- a/server.py +++ b/server.py @@ -3,14 +3,15 @@ import socketserver ADDR = "192.168.1.15" PORT = 20000 +FILE = "out.bin" + class ChunkHandler(socketserver.BaseRequestHandler): def handle(self): - i = 0 - while True: - i += 1 - print("sending %d" % i) - self.request.sendall(bytes([i % (128 - 32) + 32] * 256)) + with open(FILE, "rb") as f: + data = f.read() + print("Sending %d bytes" % len(data)) + self.request.sendall(data) def main():