1
2 import socket
3
4
4 TCP_IP = '127.0.0.1'
5 TCP_PORT = 5005
6 BUFFER_SIZE = 1024
7 MESSAGE = "Hello, World!"
8
9 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
10 s.connect((TCP_IP, TCP_PORT))
11 s.send(MESSAGE)
12 data = s.recv(BUFFER_SIZE)
13 s.close()
14
15 print ("received data:", data)
Okey we will discuss this codes next time and we will explain how to work this code lines.
Comments