Skip to content
Snippets Groups Projects
Commit 6beb2ca4 authored by Sibidharan's avatar Sibidharan :speech_balloon:
Browse files

Added function to init the server

parent ed8373c6
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,15 @@ from comm_thread import ProcessOutputThread ...@@ -7,7 +7,15 @@ from comm_thread import ProcessOutputThread
HOST = '' HOST = ''
PORT = 4444 PORT = 4444
def start_new_math_thread(conn, addr):
t = MathServerCommunicationThread(conn, addr)
t.start()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT)) s.bind((HOST, PORT))
s.listen() # Look for calling bell s.listen() # Look for calling bell
while True: # To accept many incoming connections.
conn, addr = s.accept() # Open door
start_new_math_thread(conn, addr)
s.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment