mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2024-11-05 09:05:38 +00:00
Fix
This commit is contained in:
parent
2092ef0926
commit
7343aa39ed
@ -8,11 +8,10 @@ PORT = 20000
|
||||
def main(argv):
|
||||
serve_file = argv[1]
|
||||
|
||||
def handler(serve_file):
|
||||
nonlocal serve_file
|
||||
|
||||
def handler():
|
||||
class ChunkHandler(socketserver.BaseRequestHandler):
|
||||
def handle(self):
|
||||
|
||||
with open(serve_file, "rb") as f:
|
||||
data = f.read()
|
||||
print("Sending %d bytes" % len(data))
|
||||
@ -21,7 +20,7 @@ def main(argv):
|
||||
return ChunkHandler
|
||||
|
||||
with socketserver.TCPServer(
|
||||
(ADDR, PORT), handler(serve_file),
|
||||
(ADDR, PORT), handler(),
|
||||
bind_and_activate=False) as server:
|
||||
server.allow_reuse_address = True
|
||||
server.server_bind()
|
||||
|
Loading…
Reference in New Issue
Block a user