8 lines
242 B
Python
8 lines
242 B
Python
import socket
|
|
|
|
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
client.sendto(b'hello udp server', ('127.0.0.1', 10500))
|
|
data, _ = client.recvfrom(1024)
|
|
print(f"Ответ от сервера: {data.decode('utf-8')}")
|
|
client.close()
|