初见UDP_Server
from socket import *
ip_prot = ('192.168.55.1',8080)
buffer_size = 1024
udp_sever = socket(AF_INET,SOCK_DGRAM) #DGRAM--数据报式套接字
udp_sever.bind(ip_prot)
while True:
data,addr = udp_sever.recvfrom(buffer_size)
udp_sever.sendto(data.upper(),addr)
Win a contest, win a challenge
posted on 2018-03-09 16:31 pandaboy1123 阅读(132) 评论(0) 编辑 收藏 举报