Added start_server.sh
This commit is contained in:
parent
f2fe4186ef
commit
960e5574d0
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
.venv
|
.venv
|
||||||
out
|
out
|
||||||
__pycache__
|
__pycache__
|
||||||
|
pid
|
13
server.py
13
server.py
@ -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()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user