YACWC
This commit is contained in:
20
old/af_client.py
Normal file
20
old/af_client.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import socket
|
||||
import os
|
||||
|
||||
# Client socket file
|
||||
client_socket_file = '/tmp/server_socket_use2'
|
||||
|
||||
# Create a UDP socket
|
||||
client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
|
||||
# Bind the socket to the file
|
||||
client_socket.connect(client_socket_file)
|
||||
|
||||
while True:
|
||||
# Receive data from the server
|
||||
data, _ = client_socket.recvfrom(1024)
|
||||
print("Received from server:", data.decode())
|
||||
|
||||
# Close the socket
|
||||
client_socket.close()
|
||||
|
||||
Reference in New Issue
Block a user