Skip to content

Commit 135318a

Browse files
committed
created echo-client
1 parent 6b02ecf commit 135318a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Socket_program/echo-client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import socket
2+
3+
HOST = "127.0.0.1" # The server's hostname or IP address
4+
PORT = 65432 # The port used by the server
5+
6+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
7+
s.connect((HOST, PORT))
8+
s.sendall(b"Hello, Vladimir!")
9+
data = s.recv(1024)
10+
11+
print(f"Received {data!r}")

0 commit comments

Comments
 (0)