YACWC
This commit is contained in:
21
old/af_server.py
Normal file
21
old/af_server.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import socket
|
||||
import os
|
||||
|
||||
# Server socket file
|
||||
server_socket_file = '/tmp/server_socket_use2'
|
||||
|
||||
# Create a UDP socket
|
||||
server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
|
||||
# Bind the socket to the file
|
||||
server_socket.bind(server_socket_file)
|
||||
|
||||
while True:
|
||||
# Send a message to the client
|
||||
message = b"Hello, client!"
|
||||
server_socket.sendto(message, server_socket_file)
|
||||
|
||||
# Close the socket
|
||||
server_socket.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user