Added start_server.sh

This commit is contained in:
MunyDev 2025-01-24 21:52:02 -05:00
parent f2fe4186ef
commit 960e5574d0
2 changed files with 13 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.venv .venv
out out
__pycache__ __pycache__
pid

View File

@ -48,5 +48,14 @@ class A(BaseHTTPRequestHandler):
self.wfile.write(dmr.SerializeToString()) self.wfile.write(dmr.SerializeToString())
# self.wfile.close() # self.wfile.close()
hs = HTTPServer(("0.0.0.0", 3040), A) print("Starting internal server!")
hs.serve_forever() hs = HTTPServer(("0.0.0.0", 3040), A,bind_and_activate=False)
hs.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
hs.server_bind()
hs.server_activate()
try:
hs.serve_forever()
except BaseException as e:
print("Interrupted")
hs.server_close()