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.
2 parents 8c317c7 + d392f15 commit abd0c11Copy full SHA for abd0c11
tests/client-server/client.py
@@ -0,0 +1,17 @@
1
+# Client to connect to the socket-server
2
+
3
+import socket
4
5
+# Create a socket object
6
+s = socket.socket()
7
8
+# Define the port on which you want to connect
9
+port = 12345
10
11
+# connect to the server on local computer
12
+s.connect(('127.0.0.1', port))
13
14
+# receive data from the server and decoding to get the string.
15
+print (s.recv(1024).decode())
16
+# close the connection
17
+s.close()
0 commit comments