-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp1804247Server.py
executable file
·23 lines (22 loc) · 1.09 KB
/
p1804247Server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
# ==============================================================
# SINGAPORE POLYTECHNIC |
# SCHOOL OF COMPUTING |
# ST2411 |
# PROGRAMMING IN PYTHON AND C |
# NAME: ALEK KWEK |
# CLASS: DISM/FT/1A/23 |
# ADMIN NO: 1804247 |
# YEAR: 2019 |
# ==============================================================
# source file: p1804247Server.py
# This is the server program that repsonds to client's request
# import all data from p1804247Helper.py
from p1804247Helper import *
while True:
print("waiting a new call at accept()")
connection, address = serversocket.accept()# accpet incoming request from client
if handler(connection) == 'x': #if client press 'x', the server will close
break;
serversocket.close()
print("Server stops")