Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Multithreaded Math Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
adhiyaman ganesan
Multithreaded Math Server
Commits
6beb2ca4
Commit
6beb2ca4
authored
4 years ago
by
Sibidharan
Browse files
Options
Downloads
Patches
Plain Diff
Added function to init the server
parent
ed8373c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
math-server.py
+8
-0
8 additions, 0 deletions
math-server.py
with
8 additions
and
0 deletions
math-server.py
+
8
−
0
View file @
6beb2ca4
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment