feat: add TCP and UDP client-server scripts
This commit is contained in:
1 parent
a56496622d
commit
48b3cca2c4
4 files changed
+56
No files matched your search
@@ -0,0 +1,7 @@
|
||||
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()
|
||||
Reference in new issue
Block a user