We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86985ed commit 00c2438Copy full SHA for 00c2438
server.py
@@ -3,20 +3,22 @@
3
4
5
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
6
-
+sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
7
host = socket.gethostname()
8
port = int(sys.argv[1])
9
-sock.bind(('192.168.43.219', port))
+sock.bind(('localhost', port))
10
sock.listen(5)
11
print 'server listening on 192.168.43.219:%s'% port
12
while True:
13
- c, add = sock.accept()
14
- print 'connection from ', add
15
- c.send("""
16
- <html>
17
- <h1>cieee connect ke server gw ciee </h1>
18
- </html>
+ client_connection, address = sock.accept()
+ print 'connection from ', address
+ client_connection.sendall("""\
+ HTTP/1.1 200 OK
+
+ Hello, World
19
""")
20
+ client_connection.close()
21
22
23
24
0 commit comments