This commit is contained in:
Yunjay Liu
2024-10-25 22:03:45 +08:00
parent 7d70ac8157
commit 809b1b1cd3
35 changed files with 2355 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
from socket import *
# 创建UDP套接字
serverSocket = socket(AF_INET, SOCK_DGRAM)
# 绑定本机IP地址和端口号
serverSocket.bind(('', 12000))
########## Begin ##########
# 接收客户端消息
message, address = serverSocket.recvfrom(1024)
# 将数据包消息转换为大写
message = message.upper()
#将消息传回给客户端
serverSocket.sendto(message,address)
########## End ##########