Added start_server.sh
This commit is contained in:
parent
f2fe4186ef
commit
960e5574d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.venv
|
||||
out
|
||||
__pycache__
|
||||
pid
|
11
server.py
11
server.py
@ -48,5 +48,14 @@ class A(BaseHTTPRequestHandler):
|
||||
self.wfile.write(dmr.SerializeToString())
|
||||
|
||||
# self.wfile.close()
|
||||
hs = HTTPServer(("0.0.0.0", 3040), A)
|
||||
print("Starting internal server!")
|
||||
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