Skip to content

Commit cb95c56

Browse files
committed
Finishing touches...
1 parent 1841347 commit cb95c56

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

HelloWorld.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
<!DOCTYPE html>
12
<html>
2-
<header><title>This is the title</title></header>
3+
<title>This is the title</title>
4+
<header><h1>Hello world</h1></header>
35
<body>
4-
<h1>Hello world</h1>
56
<h2>INEF001 Project 1 Semester 1 2023 Project submission </h2>
67
Name: "Quang Minh Nguyen"<br>
78
<br>

ProjectA.py renamed to ProjectA-Quang-14415297.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def start():
2121

2222

2323
def handle_client(conn, addr):
24-
global message
25-
2624
print(f"[NEW CONNECTION] {addr} connected.")
2725
try:
2826
message = conn.recv(1024).decode()
@@ -38,16 +36,18 @@ def handle_client(conn, addr):
3836
conn.send(outputdata[i].encode())
3937
conn.send("\r\n".encode())
4038

39+
conn.close()
40+
4141
except IOError:
4242
# Send response message for file not found
4343
conn.send("HTTP/1.1 404 Not Found\r\n\r\n".encode())
4444
conn.send("<html><title>404 Not Found</title><body><h1>404 Not Found</h1></body></html>\r\n".encode())
45-
conn.close()
4645

4746
# Close client socket
4847
conn.close()
4948

5049

5150
print("[STARTING] server is starting...")
5251
start()
52+
serverSocket.close()
5353
sys.exit() # Terminate the program
File renamed without changes.

0 commit comments

Comments
 (0)