mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2025-01-29 12:31:05 +00:00
Send contents of out.bin file
This commit is contained in:
parent
7deed24ac4
commit
dc671986a3
11
server.py
11
server.py
@ -3,14 +3,15 @@ import socketserver
|
|||||||
ADDR = "192.168.1.15"
|
ADDR = "192.168.1.15"
|
||||||
PORT = 20000
|
PORT = 20000
|
||||||
|
|
||||||
|
FILE = "out.bin"
|
||||||
|
|
||||||
|
|
||||||
class ChunkHandler(socketserver.BaseRequestHandler):
|
class ChunkHandler(socketserver.BaseRequestHandler):
|
||||||
def handle(self):
|
def handle(self):
|
||||||
i = 0
|
with open(FILE, "rb") as f:
|
||||||
while True:
|
data = f.read()
|
||||||
i += 1
|
print("Sending %d bytes" % len(data))
|
||||||
print("sending %d" % i)
|
self.request.sendall(data)
|
||||||
self.request.sendall(bytes([i % (128 - 32) + 32] * 256))
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user